From 08237cc3cd45313a5a5e84acd61d96b0354ecb5b Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 5 Feb 2011 05:28:44 +0100 Subject: Fixing strchr. --- libc/include/string.h | 6 ++++-- 1 file 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; } -- cgit v1.2.3