From daa17455d63584bcc921261740c71971a84f5123 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Wed, 10 Aug 2005 17:49:57 +0000 Subject: [PATCH] Fixed the base detection in RtlUnicodeStringToInteger again. svn path=/trunk/; revision=17261 --- reactos/lib/rtl/unicode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reactos/lib/rtl/unicode.c b/reactos/lib/rtl/unicode.c index d07a3947142..bab9aa7f3b3 100644 --- a/reactos/lib/rtl/unicode.c +++ b/reactos/lib/rtl/unicode.c @@ -876,7 +876,7 @@ RtlUnicodeStringToInteger( USHORT CharsRemaining = str->Length / sizeof(WCHAR); WCHAR wchCurrent; int digit; - ULONG newbase = 10; + ULONG newbase = 0; ULONG RunningTotal = 0; char bMinus = 0; @@ -911,9 +911,11 @@ RtlUnicodeStringToInteger( newbase = 16; } /* if */ } - if (base == 0) { + if (base == 0 && newbase == 0) { + base = 10; + } else if (base == 0 && newbase != 0) { base = newbase; - } else if ((base != newbase) || + } else if ((newbase != 0 && base != newbase) || (base != 2 && base != 8 && base != 10 && base != 16)) { return STATUS_INVALID_PARAMETER; -- 2.17.1