From c99e78b85cd8820616cc25e8d45a68b7686e4113 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Sat, 13 Oct 2007 15:26:20 +0000 Subject: [PATCH] * libc/stdio/vfprintf.c (_VFPRINTF_R) [__OPTIMIZE_SIZE__]: Correctly nest else within conditionals. Reported by Artur Lipowski. --- newlib/ChangeLog | 8 +++++++- newlib/libc/stdio/vfprintf.c | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 56c2e40ec..42b47a072 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2007-10-13 Eric Blake + + * libc/stdio/vfprintf.c (_VFPRINTF_R) [__OPTIMIZE_SIZE__]: + Correctly nest else within conditionals. + Reported by Artur Lipowski. + 2007-10-09 Nick Clifton * libc/sys/linux/dl/do-lookup.h (FCT): Support symbols with @@ -341,7 +347,7 @@ * libm/machine/spu/wf_log.c: Ditto. * libm/machine/spu/wf_log10.c: Ditto. * libm/machine/spu/wf_remainder.c: Ditto. - + 2007-09-21 Patrick Mansfield * libc/machine/spu/sys/uio.h: New file for readv and writev use. diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 44d46f20c..6746e9ede 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -1039,9 +1039,10 @@ reswitch: switch (ch) { cp = "(null)"; size = ((unsigned) prec > 6U) ? 6 : prec; } + else #endif /* __OPTIMIZE_SIZE__ */ #ifdef _MB_CAPABLE - else if (ch == 'S' || (flags & LONGINT)) { + if (ch == 'S' || (flags & LONGINT)) { mbstate_t ps; _CONST wchar_t *wcp; @@ -1101,8 +1102,9 @@ reswitch: switch (ch) { } cp[size] = '\0'; } + else #endif /* _MB_CAPABLE */ - else if (prec >= 0) { + if (prec >= 0) { /* * can't use strlen; can only look for the * NUL in the first `prec' characters, and -- 2.43.5