summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-10-16 12:09:43 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-10-16 12:09:43 +0000
commit6180233fd804806e7301790d2330da50ca57e71f (patch)
tree47fcbdba053baaebb80400ad1d663fa57af766bc /lib/libc/stdio/vfprintf.c
parent9acd2d9b3ce1cc08aa98adc434b11d8ef5b8b6f0 (diff)
Notes
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 c1b4e0bb2b1d..b0084c8b9221 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)