mescc: Mes C Library: Prepare for M2-Planet: memchr.
* lib/string/memchr.c: Rewrite C-constructs not supported by M2-Planet.
This commit is contained in:
parent
b4895d7495
commit
b20a388715
|
@ -24,11 +24,14 @@ void *
|
|||
memchr (void const *block, int c, size_t size)
|
||||
{
|
||||
char const *p = block;
|
||||
while (size--)
|
||||
|
||||
while (size != 0)
|
||||
{
|
||||
if (c == *p)
|
||||
return (void *) p;
|
||||
p++;
|
||||
size = size - 1;
|
||||
if (c == p[0])
|
||||
return p;
|
||||
p = p + 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue