pathmax: PATH_MAX: use pathconf only when available
[gnulib.git] / lib / strchrnul.c
index 0902c18..5ed237c 100644 (file)
@@ -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.  */