Permalink
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 370 Bytes
/* Public domain. */
#include "str.h"
unsigned int str_chr(register const char *s,int c)
{
register char ch;
register const char *t;
ch = c;
t = s;
for (;;) {
if (!*t) break; if (*t == ch) break; ++t;
if (!*t) break; if (*t == ch) break; ++t;
if (!*t) break; if (*t == ch) break; ++t;
if (!*t) break; if (*t == ch) break; ++t;
}
return t - s;
}