Mercurial > libedl
diff src/util.c @ 10:d6f8f73a0c50 v2.1
util: make strnchr an actual strnchr
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Fri, 22 Mar 2024 20:51:40 -0400 |
parents | 0c98b46eaf73 |
children | 2d7c810a1ac2 |
line wrap: on
line diff
--- a/src/util.c Fri Mar 22 20:50:47 2024 -0400 +++ b/src/util.c Fri Mar 22 20:51:40 2024 -0400 @@ -17,7 +17,7 @@ } char* EDL_internal_strnchr(const char* haystack, char needle, size_t length) { - for (; length && *haystack != needle; haystack++, length--); + for (; length && *haystack && *haystack != needle; haystack++, length--); return length ? haystack : NULL; }