mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-20 07:51:35 +08:00
strchrnul: avoid segv
* libc/string/strchrnul.c (strchrnul): Fix strchrnul.
This commit is contained in:
parent
6f714140b5
commit
0fbf39cc9f
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user