X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstrchrnul.c;h=5ed237c3e0f415ea7139f59e66e157e562d27352;hb=7f4b1f45ce477f8374d382bd75f5f0a7e865e2c6;hp=0902c18dd4b79ac1a0b927b6e9e8d750b6173825;hpb=657b5b96df1184ec39abcd047bae7d6faacce52b;p=gnulib.git diff --git a/lib/strchrnul.c b/lib/strchrnul.c index 0902c18dd..5ed237c3e 100644 --- a/lib/strchrnul.c +++ b/lib/strchrnul.c @@ -37,6 +37,8 @@ strchrnul (const char *s, int c_in) unsigned char c; c = (unsigned char) c_in; + if (!c) + return rawmemchr (s, 0); /* Handle the first few bytes by reading one byte at a time. Do this until CHAR_PTR is aligned on a longword boundary. */