summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
-rw-r--r--lib/libc/stdio/vfprintf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index c1b4e0b..b0084c8 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -759,8 +759,10 @@ reswitch: switch (ch) {
memset(&mbs, 0, sizeof(mbs));
mbseqlen = wcrtomb(cp = buf,
(wchar_t)GETARG(wint_t), &mbs);
- if (mbseqlen == (size_t)-1)
+ if (mbseqlen == (size_t)-1) {
+ fp->_flags |= __SERR;
goto error;
+ }
size = (int)mbseqlen;
} else {
*(cp = buf) = GETARG(int);
@@ -934,8 +936,10 @@ fp_begin: if (prec == -1)
cp = "(null)";
else {
convbuf = __wcsconv(wcp, prec);
- if (convbuf == NULL)
+ if (convbuf == NULL) {
+ fp->_flags |= __SERR;
goto error;
+ }
cp = convbuf;
}
} else if ((cp = GETARG(char *)) == NULL)
OpenPOWER on IntegriCloud