opti: strchr

This commit is contained in:
starnakin 2023-07-24 08:55:19 +02:00
parent a7e050c351
commit 2fab31d822

View File

@ -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++;
}
}