From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19847 invoked by alias); 9 Jan 2018 08:52:35 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 19650 invoked by uid 9078); 9 Jan 2018 08:52:34 -0000 Date: Tue, 09 Jan 2018 08:52:00 -0000 Message-ID: <20180109085234.19644.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] newlib: fvprintf: fix get_arg for !_MB_CAPABLE X-Act-Checkin: newlib-cygwin X-Git-Author: Ivan Grokhotkov X-Git-Refname: refs/heads/master X-Git-Oldrev: fcd33916ac03086b9090c68e88036afa4b25d913 X-Git-Newrev: 1d01586b62dcf80236021cc514c487a1da160de6 X-SW-Source: 2018-q1/txt/msg00001.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=1d01586b62dcf80236021cc514c487a1da160de6 commit 1d01586b62dcf80236021cc514c487a1da160de6 Author: Ivan Grokhotkov Date: Tue Jan 9 14:07:25 2018 +0800 newlib: fvprintf: fix get_arg for !_MB_CAPABLE Code path for _MB_CAPABLE scans for the '%' character and advances 'fmt' pointer past '%'. Code path for !_MB_CAPABLE leaved fmt pointing to '%', which caused the state machine to go from START to DONE state immediately. Diff: --- newlib/libc/stdio/vfprintf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 50a3478..211cb17 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -2098,6 +2098,8 @@ _DEFUN(get_arg, (data, n, fmt, ap, numargs_p, args, arg_type, last_fmt), if (*fmt == '\0') break; + + fmt++; # endif /* ! _MB_CAPABLE */ state = START; flags = 0;