X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flib%2Fstring.c;h=d223c89f48493793c52dc45dbcf288328776fd6f;hb=59f738d500f51ffc5f487344865b8bed69c26281;hp=89fa1f05c01f130bce10948d493a10cac6d29063;hpb=4d6e7520acd99ae0e231d3cfce5e72402e1cdf72;p=pintos-anon diff --git a/src/lib/string.c b/src/lib/string.c index 89fa1f0..d223c89 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -1,8 +1,4 @@ #include - -#ifdef KERNEL -#define NDEBUG -#endif #include /* Copies SIZE bytes from SRC to DST, which must not overlap. @@ -194,7 +190,7 @@ strstr (const char *haystack, const char *needle) { size_t i; - for (i = 0; i < haystack_len - needle_len; i++) + for (i = 0; i <= haystack_len - needle_len; i++) if (!memcmp (haystack + i, needle, needle_len)) return (char *) haystack + i; }