summaryrefslogtreecommitdiffstats
path: root/newlib/libc/string/strchrnul.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/string/strchrnul.c')
-rw-r--r--newlib/libc/string/strchrnul.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/newlib/libc/string/strchrnul.c b/newlib/libc/string/strchrnul.c
index 59c7311b9..afeef434e 100644
--- a/newlib/libc/string/strchrnul.c
+++ b/newlib/libc/string/strchrnul.c
@@ -43,7 +43,5 @@ _DEFUN (strchrnul, (s1, i),
{
char *s = strchr(s1, i);
- if (*s != NULL)
- return s;
- return (char *)s1 + strlen(s1);
+ return s ? s : (char *)s1 + strlen(s1);
}