projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ffd63f8
)
Fix fencepost error in strstr().
author
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 13 Dec 2005 06:47:18 +0000
(06:47 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 13 Dec 2005 06:47:18 +0000
(06:47 +0000)
Thanks to Bryan Branstetter for bug and fix.
src/lib/string.c
patch
|
blob
|
history
diff --git
a/src/lib/string.c
b/src/lib/string.c
index 01e4ecb378d462e4fb639ea01db177cb8070f977..d223c89f48493793c52dc45dbcf288328776fd6f 100644
(file)
--- 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;
}