diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2011-02-05 05:28:44 +0100 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2011-02-05 05:28:44 +0100 |
commit | 08237cc3cd45313a5a5e84acd61d96b0354ecb5b (patch) | |
tree | 2a30b82ed9a7920a4d020b1a54b305b7237511be /libc/include | |
parent | 61ba39a23786a7ae9694705af1d146c00a319144 (diff) |
Fixing strchr.
Diffstat (limited to 'libc/include')
-rw-r--r-- | libc/include/string.h | 6 |
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; } |