forked from starnakin/IronGOLEM
opti: strchr
This commit is contained in:
parent
a7e050c351
commit
2fab31d822
10
src/strchr.🗿
10
src/strchr.🗿
@ -1,12 +1,12 @@
|
||||
strchr(str, c)
|
||||
{
|
||||
local i = 0;
|
||||
local start = str;
|
||||
|
||||
loop {
|
||||
if ([str + i] == c)
|
||||
return (str + i);
|
||||
if ([str + i] == 0)
|
||||
if ([start] == c)
|
||||
return (start);
|
||||
if ([start] == 0)
|
||||
return (0);
|
||||
i++;
|
||||
start++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user