From 440d9dc470703d20a55365b3a560196e71d450d4 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 9 Feb 2015 19:24:42 +0100 Subject: Start work on filesystems. --- src/common/string.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/common') 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; } -- cgit v1.2.3