Module: wine Branch: master Commit: f897a91247d9ed7a240f0db6fa902cd0148210e6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f897a91247d9ed7a240f0db6fa...
Author: Nikolay Sivov bunglehead@gmail.com Date: Sat Dec 26 23:10:34 2009 +0300
comctl32/updown: Fix formatting for hex mode.
---
dlls/comctl32/updown.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index e87df87..076e315 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -309,7 +309,9 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr) */ static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr) { - WCHAR fmt[3] = { '%', 'd', '\0' }; + static const WCHAR fmt_hex[] = { '0', 'x', '%', '0', '4', 'X', 0 }; + static const WCHAR fmt_dec_oct[] = { '%', 'd', '\0' }; + const WCHAR *fmt; WCHAR txt[20], txt_old[20] = { 0 }; int len;
@@ -324,7 +326,7 @@ static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr) }
/* Regular window, so set caption to the number */ - if (infoPtr->Base == 16) fmt[1] = 'X'; + fmt = (infoPtr->Base == 16) ? fmt_hex : fmt_dec_oct; len = wsprintfW(txt, fmt, infoPtr->CurVal);