projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix scanf %c conversion wrongly storing a terminating null byte
[musl]
/
src
/
stdio
/
vfwscanf.c
diff --git
a/src/stdio/vfwscanf.c
b/src/stdio/vfwscanf.c
index
b1eb793
..
760864f
100644
(file)
--- a/
src/stdio/vfwscanf.c
+++ b/
src/stdio/vfwscanf.c
@@
-281,8
+281,10
@@
int vfwscanf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap)
if (size == SIZE_l) *(wchar_t **)dest = wcs;
else *(char **)dest = s;
}
- if (wcs) wcs[i] = 0;
- if (s) s[i] = 0;
+ if (t != 'c') {
+ if (wcs) wcs[i] = 0;
+ if (s) s[i] = 0;
+ }
break;
case 'd': case 'i': case 'o': case 'u': case 'x':