]> granicus.if.org Git - php/commitdiff
Fix bug #1914
authorZeev Suraski <zeev@php.net>
Sat, 31 Jul 1999 16:20:06 +0000 (16:20 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 31 Jul 1999 16:20:06 +0000 (16:20 +0000)
ext/standard/math.c

index 44b21384a16dd01e21f3f972316a3b81786d1a86..8d6250aa01ed1187de50d93c1deb0943b07afd86 100644 (file)
@@ -25,6 +25,7 @@
    +----------------------------------------------------------------------+
    | Authors: Jim Winstead (jimw@php.net)                                 |
    |          Stig Sæther Bakken <ssb@guardian.no>                        |
+   |          Zeev Suraski <zeev@zend.com>                                |
    +----------------------------------------------------------------------+
  */
 
@@ -603,6 +604,10 @@ char *_php3_number_format(double d,int dec,char dec_point,char thousand_sep)
        
        tmplen=_php3_sprintf(tmpbuf,"%.*f",dec,d);
 
+       if (!isdigit(tmpbuf[0])) {
+               return tmpbuf;
+       }
+
        for (t=tmpbuf; *t; t++) {
                if (*t=='.') {
                        *t = dec_point;