Merge pull request #900 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / class / corlib / System / UInt32.cs
index f78ee9dbab20297f91be7f9e9db1cd9425a01742..0e88b33012bbfec9c5a6758c131adee29fd494de 100644 (file)
@@ -183,7 +183,7 @@ namespace System
                        NumberFormatInfo nfi = null;
                        if (provider != null) {
                                Type typeNFI = typeof (NumberFormatInfo);
-                               nfi = (NumberFormatInfo) provider.GetFormat (typeNFI);
+                               nfi = provider.GetFormat (typeNFI) as NumberFormatInfo;
                        }
                        if (nfi == null)
                                nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;
@@ -277,7 +277,7 @@ namespace System
 
                        // Number stuff
                        // Just the same as Int32, but this one adds instead of substract
-                       do {
+                       while (pos < s.Length) {
 
                                if (!Int32.ValidDigit (s [pos], AllowHexSpecifier)) {
                                        if (AllowThousands &&
@@ -325,7 +325,7 @@ namespace System
                                                exc = new OverflowException (Locale.GetText ("Value too large or too small."));
                                        return false;
                                }
-                       } while (pos < s.Length);
+                       }
 
                        // Post number stuff
                        if (nDigits == 0) {