diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-01-05 14:35:53 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-01-05 14:35:53 -0800 |
commit | c6c6e15e9f13e45bc7a1e2626ca41e03f0ba0983 (patch) | |
tree | 58ed5d37629925ea47c6be8fc6f6b3da24c74c37 /lib.c | |
parent | 81abe0f260dcfb4bb5d6b9f5ddf358a65e960cab (diff) | |
download | txr-c6c6e15e9f13e45bc7a1e2626ca41e03f0ba0983.tar.gz txr-c6c6e15e9f13e45bc7a1e2626ca41e03f0ba0983.tar.bz2 txr-c6c6e15e9f13e45bc7a1e2626ca41e03f0ba0983.zip |
nthcdr: terminate loop if end of list hit.
* lib.c (nthcdr): Terminate loop when nil is
hit rather than continuing to count down to zero.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -726,7 +726,7 @@ val nthcdr(val pos, val list) gc_hint(list); - while (n-- > 0) + while (list && n-- > 0) list = cdr(list); return list; |