cvs: /php4/ext/standard math.c
| From: | Andi Gutmans | Date: | Sat, 15 Apr 2000 13:53:32 +0000 |
| Subject: | cvs: /php4/ext/standard math.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-13582@lists.php.net to get a copy of this message | ||
andi Sat Apr 15 06:53:32 2000 EDT
Modified files:
/php4/ext/standard math.c
Log:
@ Fix bug in number_format (Jon Forsberg)
Index: php4/ext/standard/math.c
diff -u php4/ext/standard/math.c:1.20 php4/ext/standard/math.c:1.21
--- php4/ext/standard/math.c:1.20 Sat Apr 8 16:53:19 2000
+++ php4/ext/standard/math.c Sat Apr 15 06:53:32 2000
@@ -25,6 +25,7 @@
#include "phpmath.h"
#include <math.h>
+#include <float.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
@@ -612,7 +613,7 @@
d = -d;
}
dec = MAX(0,dec);
- tmpbuf = (char *) emalloc(32+dec);
+ tmpbuf = (char *) emalloc(1+DBL_MAX_10_EXP+1+dec+1);
tmplen=sprintf(tmpbuf,"%.*f",dec,d);