fix over-read in %ls with non-wide scanf
This commit is contained in:
parent
9ab180fa57
commit
2dd5dc78d4
1 changed files with 1 additions and 0 deletions
|
|
@ -312,6 +312,7 @@ int vfscanf(FILE *f, const char *fmt, va_list ap)
|
||||||
if (readwc(c, &wcs, &st) < 0)
|
if (readwc(c, &wcs, &st) < 0)
|
||||||
goto input_fail;
|
goto input_fail;
|
||||||
}
|
}
|
||||||
|
shunget(f);
|
||||||
if (!mbsinit(&st)) goto input_fail;
|
if (!mbsinit(&st)) goto input_fail;
|
||||||
if (dest) *wcs++ = 0;
|
if (dest) *wcs++ = 0;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue