[egl] shader: fix reliance on null terminated strings

Compiled in resources often will not contain a null terminator, as such
we must not use functions that rely on it. This implements a memsearch
function that performs like strstr on a buffer instead of a null
terminated string.
This commit is contained in:
Geoffrey McRae committed 2023-11-11 13:48:41 +11:00
1 parent 43f9a4c0e1
commit cce12508cc
3 files changed
+43 -10

No files matched your search

+6
View File
@@ -37,4 +37,10 @@ bool str_containsValue(const char * list, char delimiter, const char * value);
// Local implementation of strdup
char * lg_strdup(const char *s);
// search a non null terminated buffer for a value
const char * memsearch(
const char * haystack, size_t haystackSize,
const char * needle , size_t needleSize ,
const char * offset);
#endif