summaryrefslogtreecommitdiff
path: root/libc/include
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-02-05 05:28:44 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-02-05 05:28:44 +0100
commit08237cc3cd45313a5a5e84acd61d96b0354ecb5b (patch)
tree2a30b82ed9a7920a4d020b1a54b305b7237511be /libc/include
parent61ba39a23786a7ae9694705af1d146c00a319144 (diff)
Fixing strchr.
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/string.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/include/string.h b/libc/include/string.h
index 2ec2a84..cd58681 100644
--- a/libc/include/string.h
+++ b/libc/include/string.h
@@ -79,9 +79,11 @@ static inline char * strncpy(char * s1, const char * s2, size_t n) {
}
static inline const char * strchr(const char * s, char c) {
- while (*s)
- if (*s++ == c)
+ while (*s) {
+ if (*s == c)
return s;
+ s++;
+ }
return NULL;
}