1 #ifdef HAVE_CONFIG_H 2 # include <config.h> 3 #endif 4 5 #include <string.h> /* strlen,strchr */ 6 #include <stddef.h> /* size_t */ 7 8 strchrnul(const char * s,int c)9char *strchrnul(const char *s, int c) 10 { 11 char *p = strchr(s, c); 12 13 if (p == NULL) 14 { 15 return (char *)(s + strlen(s)); 16 } 17 else 18 { 19 return p; 20 } 21 } 22