From edfe34e241aafe19e6b29840e18ce318a2d22d61 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 30 May 2025 01:10:33 -0700 Subject: 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. --- buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buf.c b/buf.c index d5782dc2..41de5b28 100644 --- a/buf.c +++ b/buf.c @@ -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)); -- cgit v1.2.3