X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstrchrnul.c;h=f834d3434d7a761a051bd91a2add2f88c6808cc9;hb=7c59efd8bc7abb8c79ae969a65ece95e68c9be4c;hp=0902c18dd4b79ac1a0b927b6e9e8d750b6173825;hpb=657b5b96df1184ec39abcd047bae7d6faacce52b;p=gnulib.git diff --git a/lib/strchrnul.c b/lib/strchrnul.c index 0902c18dd..f834d3434 100644 --- a/lib/strchrnul.c +++ b/lib/strchrnul.c @@ -1,5 +1,5 @@ /* Searching in a string. - Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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. */