mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-23 22:52:23 +03:00
avoid depending on POSIX symbol in code used from plain C functions
This commit is contained in:
parent
03de77f521
commit
8b57a81577
@ -3,7 +3,9 @@
|
||||
size_t __string_read(FILE *f, unsigned char *buf, size_t len)
|
||||
{
|
||||
char *src = f->cookie;
|
||||
size_t k = strnlen(src, len+256);
|
||||
size_t k = len+256;
|
||||
char *end = memchr(src, 0, k);
|
||||
if (end) k = end-src;
|
||||
if (k < len) len = k;
|
||||
memcpy(buf, src, len);
|
||||
f->rpos = (void *)(src+len);
|
||||
|
Loading…
Reference in New Issue
Block a user