From: Zeev Suraski Date: Sat, 31 Jul 1999 16:20:06 +0000 (+0000) Subject: Fix bug #1914 X-Git-Tag: php-4.0b2~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb3d12c6dd2c8effbf79a10fa2d75109ec998ed5;p=php Fix bug #1914 --- diff --git a/ext/standard/math.c b/ext/standard/math.c index 44b21384a1..8d6250aa01 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -25,6 +25,7 @@ +----------------------------------------------------------------------+ | Authors: Jim Winstead (jimw@php.net) | | Stig Sæther Bakken | + | Zeev Suraski | +----------------------------------------------------------------------+ */ @@ -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;