X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bb809a9a80e31a33a9e00598897acdaf2b874972..cb41a69b152026d6c586d21148e34913291cd733:/src/common/wxprintf.cpp diff --git a/src/common/wxprintf.cpp b/src/common/wxprintf.cpp index fada74e496..69cb20cbae 100644 --- a/src/common/wxprintf.cpp +++ b/src/common/wxprintf.cpp @@ -4,7 +4,6 @@ // Author: Ove Kaven // Modified by: Ron Lee, Francesco Montorsi // Created: 09/04/99 -// RCS-ID: $Id$ // Copyright: (c) wxWidgets copyright // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -142,9 +141,16 @@ static int wxDoVsnprintf(CharType *buf, size_t lenMax, const CharType *toparse = format; for (i=0; i < parser.nargs; i++) { + wxPrintfConvSpec& spec = parser.specs[i]; + + // skip any asterisks, they're processed as part of the conversion they + // apply to + if ( spec.m_type == wxPAT_STAR ) + continue; + // copy in the output buffer the portion of the format string between // last specifier and the current one - size_t tocopy = ( parser.arg[i].m_pArgPos - toparse ); + size_t tocopy = ( spec.m_pArgPos - toparse ); lenCur += wxCopyStrWithPercents(lenMax - lenCur, buf + lenCur, tocopy, toparse); @@ -155,8 +161,8 @@ static int wxDoVsnprintf(CharType *buf, size_t lenMax, } // process this specifier directly in the output buffer - int n = parser.arg[i].Process(buf+lenCur, lenMax - lenCur, - &argdata[parser.arg[i].m_pos], lenCur); + int n = spec.Process(buf+lenCur, lenMax - lenCur, + &argdata[spec.m_pos], lenCur); if (n == -1) { buf[lenMax-1] = wxT('\0'); // be sure to always NUL-terminate the string @@ -166,7 +172,7 @@ static int wxDoVsnprintf(CharType *buf, size_t lenMax, // the +1 is because wxPrintfConvSpec::m_pArgEnd points to the last character // of the format specifier, but we are not interested to it... - toparse = parser.arg[i].m_pArgEnd + 1; + toparse = spec.m_pArgEnd + 1; } // copy portion of the format string after last specifier