From 46f176d349f4f10cdf16e808bbafafb59a7842de Mon Sep 17 00:00:00 2001 From: Jake Koroman Date: Tue, 2 Sep 2025 10:36:31 -0400 Subject: fix array out of bounds access. --- jrk.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/jrk.h b/jrk.h index ad7c52e..0d4cade 100644 --- 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; -- cgit v1.2.3