blob: 3691826154fcf65cd5ebf1fdeb347dd53f024d0c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include "str.h"
unsigned int str_chr(s,c)
register char *s;
int c;
{
register char ch;
register 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;
}
|