Justtechjobs.com Find a programming school near you






Online Campus Both


php4-beta | 200004

[PHP4BETA] cvs: /php4/ext/standard math.c From: Andi Gutmans (andi <email protected>)
Date: 04/15/00

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);
 

-- 
PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
To unsubscribe, e-mail: php4beta-unsubscribe <email protected>
For additional commands, e-mail: php4beta-help <email protected>
To contact the list administrators, e-mail: php4beta-admin <email protected>