]> granicus.if.org Git - php/commitdiff
'0b' could be the beginning of a hex string (without leading '0x') so if
authorSean Bright <elixer@php.net>
Sun, 10 Feb 2002 23:19:38 +0000 (23:19 +0000)
committerSean Bright <elixer@php.net>
Sun, 10 Feb 2002 23:19:38 +0000 (23:19 +0000)
the user specifies base 16, use that instead.

ext/gmp/gmp.c

index c20f2ac3a39e6c6b8727eea7d2769541dbaf96a0..fc90d6c6f4d92fbc9404e1f8b401a54dd2fdb107 100644 (file)
@@ -214,7 +214,7 @@ static int convert_to_gmp(mpz_t * *gmpnumber, zval **val, int base)
                                        if (numstr[1] == 'x' || numstr[1] == 'X') {
                                                base = 16;
                                                skip_lead = 1;
-                                       } else if (numstr[1] == 'b' || numstr[1] == 'B') {
+                                       } else if (base != 16 && (numstr[1] == 'b' || numstr[1] == 'B')) {
                                                base = 2;
                                                skip_lead = 1;
                                        }