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)
|
memchr (void const *block, int c, size_t size)
|
||||||
{
|
{
|
||||||
char const *p = block;
|
char const *p = block;
|
||||||
while (size--)
|
|
||||||
|
while (size != 0)
|
||||||
{
|
{
|
||||||
if (c == *p)
|
size = size - 1;
|
||||||
return (void *) p;
|
if (c == p[0])
|
||||||
p++;
|
return p;
|
||||||
|
p = p + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue