From 6466208ec051e58b824cc3c839b6b086ae910fe6 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 16 Jul 2016 23:39:51 +0200 Subject: Progress on stdio impementation --- src/common/libc/string.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/common/libc/string.c') 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; } -- cgit v1.2.3