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 | 41a8e915e6684836ba5709cfa9c4a4f85245a136 (patch) | |
tree | 58ed5d37629925ea47c6be8fc6f6b3da24c74c37 | |
parent | 63c6d749f1c8185f4ee88737cb5f53bfb181ee03 (diff) | |
download | txr-41a8e915e6684836ba5709cfa9c4a4f85245a136.tar.gz txr-41a8e915e6684836ba5709cfa9c4a4f85245a136.tar.bz2 txr-41a8e915e6684836ba5709cfa9c4a4f85245a136.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.
-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; |