aboutsummaryrefslogtreecommitdiff
path: root/src/common/libc/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/libc/string.c')
-rw-r--r--src/common/libc/string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/libc/string.c b/src/common/libc/string.c
index 4b99dda..b2c6bb8 100644
--- a/src/common/libc/string.c
+++ b/src/common/libc/string.c
@@ -176,8 +176,9 @@ size_t strspn(const char *s, const char *accept) {
}
const char *strstr(const char *haystack, const char *needle) {
+ int n = strlen(needle);
for (const char* p = haystack; *p != 0; p++) {
- if (!strcmp(p, needle)) return p;
+ if (!strncmp(p, needle, n)) return p;
}
return NULL;
}