diff options
author | Alex Auvolat <alex@adnab.me> | 2016-07-16 23:39:51 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2016-07-16 23:39:51 +0200 |
commit | 6466208ec051e58b824cc3c839b6b086ae910fe6 (patch) | |
tree | 434741997865ec6f0c4c3badb4fcfde557a7af35 /src/common/libc/string.c | |
parent | bb2dd23f315bafa7b0b64845c2fe25d7a0893b10 (diff) | |
download | kogata-6466208ec051e58b824cc3c839b6b086ae910fe6.tar.gz kogata-6466208ec051e58b824cc3c839b6b086ae910fe6.zip |
Progress on stdio impementation
Diffstat (limited to 'src/common/libc/string.c')
-rw-r--r-- | src/common/libc/string.c | 3 |
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; } |