summaryrefslogtreecommitdiff
path: root/ext/standard/math.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-07-31 16:20:06 +0000
committerZeev Suraski <zeev@php.net>1999-07-31 16:20:06 +0000
commiteb3d12c6dd2c8effbf79a10fa2d75109ec998ed5 (patch)
tree15176d1a1f33a8e8063b75a32a2002696fbc24f9 /ext/standard/math.c
parent338405d3430f97e89420830681762c57b09ca1b5 (diff)
downloadphp-git-eb3d12c6dd2c8effbf79a10fa2d75109ec998ed5.tar.gz
Fix bug #1914
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r--ext/standard/math.c5
1 files changed, 5 insertions, 0 deletions
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 <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;