iliaa           Sun Sep 28 21:07:56 2003 EDT

  Modified files:              
    /php-src/main       spprintf.c 
  Log:
  Fixed Bug #25665 (var_dump() hangs on Nan and INF).
  
  
Index: php-src/main/spprintf.c
diff -u php-src/main/spprintf.c:1.19 php-src/main/spprintf.c:1.20
--- php-src/main/spprintf.c:1.19        Sun Sep 14 05:50:36 2003
+++ php-src/main/spprintf.c     Sun Sep 28 21:07:55 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: spprintf.c,v 1.19 2003/09/14 09:50:36 helly Exp $ */
+/* $Id: spprintf.c,v 1.20 2003/09/29 01:07:55 iliaa Exp $ */
 
 /* This is the spprintf implementation.
  * It has emerged from apache snprintf. See original header:
@@ -569,6 +569,22 @@
                                                default:
                                                        goto fmt_error;
                                        }
+
+                                       if (zend_isnan(fp_num)) {
+                                               s = "NAN";
+                                               s_len = 3;
+                                               break;
+                                       } else if (zend_isinf(fp_num)) {
+                                               if (fp_num > 0) {
+                                                       s = "INF";
+                                                       s_len = 3;
+                                               } else {
+                                                       s = "-INF";
+                                                       s_len = 4;
+                                               }
+                                               break;
+                                       }
+
                                        if (adjust_precision == NO)
                                                precision = FLOAT_DIGITS;
                                        else if (precision == 0)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to