From: Václav Slavík Date: Thu, 5 Sep 2002 23:02:56 +0000 (+0000) Subject: fix va_arg(.,short int) problem X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/40dd6c07aacaddf36c4dec2676bf04e1fc2f77f6 fix va_arg(.,short int) problem git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index 2d2668191a..63ae0e26e7 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -280,7 +280,9 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax, ::sprintf(szScratch, s_szFlags, val); } else if (ilen == -1) { - short int val = va_arg(argptr, short int); + // NB: 'short int' value passed through '...' + // is promoted to 'int' + short int val = (short int) va_arg(argptr, int); ::sprintf(szScratch, s_szFlags, val); } else if (ilen == 1) {