diff options
| author | Jake Koroman <jake@jakekoroman.com> | 2025-09-02 10:36:31 -0400 |
|---|---|---|
| committer | Jake Koroman <jake@jakekoroman.com> | 2025-09-02 10:36:31 -0400 |
| commit | 46f176d349f4f10cdf16e808bbafafb59a7842de (patch) | |
| tree | 04579ec394163d9228a1ac0ae54f30d7d9cbe4e7 | |
| parent | 5b8f96812dfd56a7e2fa60097f8099db9368a3f4 (diff) | |
fix array out of bounds access.
| -rw-r--r-- | jrk.h | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -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; |
