From 1473f4d4dbc840d67241c33179e9d3f58efef591 Mon Sep 17 00:00:00 2001 From: Daniel Lehman Date: Wed, 12 Sep 2012 19:24:19 -0700 Subject: [PATCH] msvcp90: keep given base in num_get__Getifld the 'if(!base && "first char is zero")' is meant to try to detect the base if it's not given if base is given though, flow hits the 'else base = 10' so an oct or hex base is always treated as dec the code change moves that 'else base = 10' to the if (!base) scope --- dlls/msvcp90/locale.c | 36 ++++++++++++++++++++---------------- 1 files changed, 20 insertions(+), 16 deletions(-) diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index ddf1424..b06922b 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -4629,17 +4629,19 @@ static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator istreambuf_iterator_wchar_inc(first); } - if(!base && first->strbuf && first->val==digits[0]) { - istreambuf_iterator_wchar_inc(first); - if(first->strbuf && (first->val==mb_to_wc('x', &this->cvt) || first->val==mb_to_wc('x', &this->cvt))) { + if(!base) { + if(first->strbuf && first->val==digits[0]) { istreambuf_iterator_wchar_inc(first); - base = 22; + if(first->strbuf && (first->val==mb_to_wc('x', &this->cvt) || first->val==mb_to_wc('x', &this->cvt))) { + istreambuf_iterator_wchar_inc(first); + base = 22; + }else { + error = FALSE; + base = 8; + } }else { - error = FALSE; - base = 8; + base = 10; } - }else { - base = 10; } digits[base] = 0; @@ -5710,17 +5712,19 @@ int __cdecl num_get_char__Getifld(const num_get *this, char *dest, istreambuf_it istreambuf_iterator_char_inc(first); } - if(!base && first->strbuf && first->val=='0') { - istreambuf_iterator_char_inc(first); - if(first->strbuf && (first->val=='x' || first->val=='X')) { + if(!base) { + if(first->strbuf && first->val=='0') { istreambuf_iterator_char_inc(first); - base = 22; + if(first->strbuf && (first->val=='x' || first->val=='X')) { + istreambuf_iterator_char_inc(first); + base = 22; + }else { + error = FALSE; + base = 8; + } }else { - error = FALSE; - base = 8; + base = 10; } - }else { - base = 10; } if(sep) { -- 1.6.0.4