wm: teppich

ref: 10784c7106b0538ad853c421daf33c0d6597ff5d
dir: /libc/strchr.c/

View raw version
#include <u.h>
#include <libc.h>

char*
strchr(char *s, char c)
{
	char *new = strdup(s);
	while(*new != c || *new != '\0')
		new++;
	
	if(*new == c)
		return new;
	
	return nil;
}