diff options
Diffstat (limited to 'src/common/string.c')
-rw-r--r-- | src/common/string.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common/string.c b/src/common/string.c index 2c73900..027bf03 100644 --- a/src/common/string.c +++ b/src/common/string.c @@ -10,10 +10,9 @@ size_t strlen(const char* str) { } char *strchr(const char *str, char c) { - while (*str) { + do { if (*str == c) return (char*)str; - str++; - } + } while (*(str++)); return NULL; } |