diff options
Diffstat (limited to 'libc/stdio')
| -rw-r--r-- | libc/stdio/open_memstream.c | 4 | ||||
| -rw-r--r-- | libc/stdio/vsnprintf.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libc/stdio/open_memstream.c b/libc/stdio/open_memstream.c index e7b1cf435..5861017e4 100644 --- a/libc/stdio/open_memstream.c +++ b/libc/stdio/open_memstream.c @@ -97,7 +97,7 @@ static int oms_seek(register void *cookie, __offmax_t *pos, int whence) if (buf) { *COOKIE->bufloc = COOKIE->buf = buf; COOKIE->len = leastlen; - memset(buf + COOKIE->eof, leastlen - COOKIE->eof, 0); /* 0-fill */ + memset(buf + COOKIE->eof, 0, leastlen - COOKIE->eof); /* 0-fill */ } else { /* TODO: check glibc errno setting... */ return -1; @@ -107,7 +107,7 @@ static int oms_seek(register void *cookie, __offmax_t *pos, int whence) *pos = COOKIE->pos = --leastlen; if (leastlen > COOKIE->eof) { - memset(COOKIE->buf + COOKIE->eof, leastlen - COOKIE->eof, 0); + memset(COOKIE->buf + COOKIE->eof, 0, leastlen - COOKIE->eof); *COOKIE->sizeloc = COOKIE->eof; } diff --git a/libc/stdio/vsnprintf.c b/libc/stdio/vsnprintf.c index 8bc697a48..5cdb6ebf8 100644 --- a/libc/stdio/vsnprintf.c +++ b/libc/stdio/vsnprintf.c @@ -46,7 +46,7 @@ int vsnprintf(char *__restrict buf, size_t size, __INIT_MBSTATE(&(f.__state)); #endif /* __STDIO_MBSTATE */ -#if defined(__USE_OLD_VFPRINTF__) && defined(__UCLIBC_HAS_THREADS__) +#if (defined(__STDIO_BUFFERS) || defined(__USE_OLD_VFPRINTF__)) && defined(__UCLIBC_HAS_THREADS__) f.__user_locking = 1; /* Set user locking. */ STDIO_INIT_MUTEX(f.__lock); #endif |
