mirror of
https://git.zap.org.au/git/trader.git
synced 2024-09-01 17:14:15 -04:00
Bug fix: wchar_t may be smaller than int
On some platforms (eg, Cygwin), wchar_t is smaller than int, so type promotion requires an appropriate cast for va_arg.
This commit is contained in:
parent
1f3be16193
commit
82ca16e110
@ -1092,7 +1092,9 @@ int mkchstr_parse (const wchar_t *restrict format,
|
||||
break;
|
||||
|
||||
case TYPE_WCHAR:
|
||||
format_arg->a.a_wchar = va_arg(args, wchar_t);
|
||||
format_arg->a.a_wchar = (wchar_t) (sizeof(wchar_t) < sizeof(int) ?
|
||||
va_arg(args, int) :
|
||||
va_arg(args, wchar_t));
|
||||
break;
|
||||
|
||||
case TYPE_INT:
|
||||
|
Loading…
Reference in New Issue
Block a user