wm: teppich

ref: 27e3ce47b705e8c01f28c38089a3e8ad9a797698
dir: /libc/strccnt.c/

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

int
strccnt(char *s, char c)
{
	int i, t;
	
	i = 0;
	t = 0;
	while(i < strlen(s))
	{
		if(s[i] == c)
			t++;
		i++;
	}
	return t;
}