summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--newlib/ChangeLog4
-rw-r--r--newlib/libc/string/strchrnul.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index f10416bc0..ca8b92cff 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,7 @@
+2011-04-15 Eric Blake <eblake@redhat.com>
+
+ * libc/string/strchrnul.c (strchrnul): Fix strchrnul.
+
2011-03-27 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* libc/include/string.h (strchrnul): Declare.
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);
}