From 2f35bda1714c6860453c45a92963c08385b1d9fb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Apr 2016 17:09:12 +0200 Subject: [PATCH] Fix handling of "%z" in format strings in 64 bit MSVC builds ChangeFmtChar(), used only to replace "%z" with "%I" when using MSVC, was buggy and forgot to increment the pointer to the next format character, meaning that the "I" we wanted to insert into the format string was simply lost, overwritten by the next character ("d", "u" or "x"). This actually didn't change anything in 32 bit builds, but it did result in not using the correct size in 64 bit ones, e.g. using "%zx" with (size_t)-1 output only "ffffffff" instead of the correct "ffffffffffffffff". See #17492. --- src/common/strvararg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/strvararg.cpp b/src/common/strvararg.cpp index c448c1fb26..b8c2e8056a 100644 --- a/src/common/strvararg.cpp +++ b/src/common/strvararg.cpp @@ -361,7 +361,7 @@ private: CopyAllBefore(); } - *m_fmtLast = ch; + *m_fmtLast++ = ch; } void CopyAllBefore()