projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rewrite popen to use posix_spawn instead of fragile vfork hacks
[musl]
/
src
/
stdio
/
vswscanf.c
diff --git
a/src/stdio/vswscanf.c
b/src/stdio/vswscanf.c
index
4396d7d
..
7a2f7c7
100644
(file)
--- a/
src/stdio/vswscanf.c
+++ b/
src/stdio/vswscanf.c
@@
-1,4
+1,5
@@
#include "stdio_impl.h"
#include "stdio_impl.h"
+#include <wchar.h>
static size_t wstring_read(FILE *f, unsigned char *buf, size_t len)
{
static size_t wstring_read(FILE *f, unsigned char *buf, size_t len)
{
@@
-17,13
+18,13
@@
static size_t wstring_read(FILE *f, unsigned char *buf, size_t len)
f->rend = f->buf + k;
f->cookie = (void *)src;
f->rend = f->buf + k;
f->cookie = (void *)src;
- if (!len) return 0;
+ if (!len
|| !k
) return 0;
*buf = *f->rpos++;
return 1;
}
*buf = *f->rpos++;
return 1;
}
-int vswscanf(const wchar_t *
s, const wchar_t *
fmt, va_list ap)
+int vswscanf(const wchar_t *
restrict s, const wchar_t *restrict
fmt, va_list ap)
{
unsigned char buf[256];
FILE f = {
{
unsigned char buf[256];
FILE f = {