aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/string.c5
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;
}