jrk

my own c stdlib to keep myself sane
git clone git://git.jakekoroman.com/jrk
Log | Files | Refs

commit 46f176d349f4f10cdf16e808bbafafb59a7842de
parent 5b8f96812dfd56a7e2fa60097f8099db9368a3f4
Author: Jake Koroman <jake@jakekoroman.com>
Date:   Tue,  2 Sep 2025 10:36:31 -0400

fix array out of bounds access.

Diffstat:
Mjrk.h | 7+------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/jrk.h b/jrk.h @@ -423,11 +423,7 @@ jrk_sv_from_parts(char *data, u64 count) { jrk_StringView result = {0}; result.data = data; - - if (data[count] == '\0') - result.count = count-1; - else - result.count = count; + result.count = count; return result; } @@ -477,7 +473,6 @@ jrk_sv_chop_delim(jrk_StringView *sv, char delim) } else { sv->data += i; sv->count -= i; - result.count++; } return result;