summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-23 05:57:46 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-23 05:57:46 -0700
commit0642a9d229fd3e478c2aa0decea91b3a9bef2024 (patch)
treee255b0489f482564b9500790a4126eeff3020bd8 /lib.c
parent312ce645143aa6ba2890b57830523fea98a373e4 (diff)
downloadtxr-0642a9d229fd3e478c2aa0decea91b3a9bef2024.tar.gz
txr-0642a9d229fd3e478c2aa0decea91b3a9bef2024.tar.bz2
txr-0642a9d229fd3e478c2aa0decea91b3a9bef2024.zip
lack of optional arg defaulting in lazy_sub_str.
* lib.c (lazy_sub_str): Check from and to args correctly using null_or_missing_p instead of comparing to nil.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 671e13ac..42f6cb04 100644
--- a/lib.c
+++ b/lib.c
@@ -2819,7 +2819,7 @@ static val lazy_sub_str(val lstr, val from, val to)
val len = nil;
val len_pfx = length_str(lstr->ls.prefix);
- if (from == nil) {
+ if (null_or_missing_p(from)) {
from = zero;
} else if (from == t) {
return null_string;
@@ -2838,7 +2838,7 @@ static val lazy_sub_str(val lstr, val from, val to)
}
}
- if (to == nil || to == t) {
+ if (null_or_missing_p(to) || to == t) {
to = t;
} else {
if (lt(to, zero)) {