diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-05-30 01:10:33 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-05-30 01:10:33 -0700 |
commit | edfe34e241aafe19e6b29840e18ce318a2d22d61 (patch) | |
tree | c78e7d1af14b9b1ebd1332dfeda1d393b6373aa8 | |
parent | b01dcd8533183810adec7bd52edab4868a521436 (diff) | |
download | txr-edfe34e241aafe19e6b29840e18ce318a2d22d61.tar.gz txr-edfe34e241aafe19e6b29840e18ce318a2d22d61.tar.bz2 txr-edfe34e241aafe19e6b29840e18ce318a2d22d61.zip |
buf: bug in sub_buf.
* buf.c (sub_buf): Wrong comparison of from to 0 gets
interpreted as a null pointer check (is from nil);
we want zero at that point in the code.
-rw-r--r-- | buf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -433,7 +433,7 @@ val sub_buf(val buf, val from, val to) if (ge(from, to)) { return make_buf(zero, nil, zero); - } else if (from == 0 && to == len) { + } else if (from == zero && to == len) { return buf; } else { return make_duplicate_buf(minus(to, from), b->data + c_num(from, self)); |