From e05b80abcba62ce379de8cea23f38b0b2af68498 Mon Sep 17 00:00:00 2001 From: wrmr Date: Sat, 9 Nov 2024 02:27:28 -0500 Subject: fix counting dest->n == 0 as end-of-src in strv_split --- str.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'str.c') diff --git a/str.c b/str.c index e0ea194..1c09f11 100644 --- a/str.c +++ b/str.c @@ -56,7 +56,7 @@ int strv_split(strv_t *src, int chr, strv_t *dest) { }; src->s = c ? c + 1 : &src->s[src->n]; src->n -= dest->n + !!c; - return dest->n > 0; + return (src->n + dest->n) > 0; } char strv_next(strv_t *s) { -- cgit 1.4.1-2-gfad0