1 #include <u.h> 2 #include <libc.h> 3 4 char* 5 strchr(char *s, char c) 6 { 7 char c1; 8 9 if(c == 0) { 10 while(*s++) 11 ; 12 return s-1; 13 } 14 15 while(c1 = *s++) 16 if(c1 == c) 17 return s-1; 18 return 0; 19 } 20