X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flib%2Fstring.c;h=d223c89f48493793c52dc45dbcf288328776fd6f;hb=59f738d500f51ffc5f487344865b8bed69c26281;hp=01e4ecb378d462e4fb639ea01db177cb8070f977;hpb=615bf3b3d2a8573ed6fb9ddc0055745e163ac999;p=pintos-anon diff --git a/src/lib/string.c b/src/lib/string.c index 01e4ecb..d223c89 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -190,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; }