summaryrefslogtreecommitdiff
path: root/userland/libc/string/strchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'userland/libc/string/strchr.c')
-rw-r--r--userland/libc/string/strchr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/userland/libc/string/strchr.c b/userland/libc/string/strchr.c
index 1995547..179e47c 100644
--- a/userland/libc/string/strchr.c
+++ b/userland/libc/string/strchr.c
@@ -2,10 +2,12 @@
char *strchr(const char *s, int c) {
for (; *s; s++) {
- if (*s == (char)c)
- return (char*)s;
+ if (*s == (char)c) {
+ return (char *)s;
+ }
}
- if ((char)c == '\0')
+ if ((char)c == '\0') {
return (char *)s;
+ }
return NULL;
}