From 40dd6c07aacaddf36c4dec2676bf04e1fc2f77f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 5 Sep 2002 23:02:56 +0000 Subject: [PATCH] fix va_arg(.,short int) problem git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wxchar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {