iliaa           Sun Jul 18 13:29:46 2004 EDT

  Added files:                 (Branch: PHP_4_3)
    /php-src/ext/standard/tests/strings bug28633.phpt 

  Modified files:              
    /php-src/ext/standard       formatted_print.c 
    /php-src/ext/standard/tests/strings bug22207.phpt 
    /php-src    NEWS 
  Log:
  MFH: Fixed bug #28633 (sprintf incorrectly adding padding to floats).
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/formatted_print.c?r1=1.59.2.10&r2=1.59.2.11&ty=u
Index: php-src/ext/standard/formatted_print.c
diff -u php-src/ext/standard/formatted_print.c:1.59.2.10 
php-src/ext/standard/formatted_print.c:1.59.2.11
--- php-src/ext/standard/formatted_print.c:1.59.2.10    Sun May 16 17:20:30 2004
+++ php-src/ext/standard/formatted_print.c      Sun Jul 18 13:29:45 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: formatted_print.c,v 1.59.2.10 2004/05/16 21:20:30 helly Exp $ */
+/* $Id: formatted_print.c,v 1.59.2.11 2004/07/18 17:29:45 iliaa Exp $ */
 
 #include <math.h>                              /* modf() */
 #include "php.h"
@@ -398,9 +398,6 @@
 
        numbuf[i] = '\0';
 
-       if (precision > 0) {
-               width += (precision + 1);
-       }
        php_sprintf_appendstring(buffer, pos, size, numbuf, width, 0, padding,
                                                         alignment, i, sign, 0, 
always_sign);
 }
http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/bug22207.phpt?r1=1.1.2.1&r2=1.1.2.2&ty=u
Index: php-src/ext/standard/tests/strings/bug22207.phpt
diff -u php-src/ext/standard/tests/strings/bug22207.phpt:1.1.2.1 
php-src/ext/standard/tests/strings/bug22207.phpt:1.1.2.2
--- php-src/ext/standard/tests/strings/bug22207.phpt:1.1.2.1    Thu Feb 13 12:26:02 
2003
+++ php-src/ext/standard/tests/strings/bug22207.phpt    Sun Jul 18 13:29:45 2004
@@ -7,5 +7,5 @@
 ?>
 --EXPECT--
 1.1000e+0
-string(17) "       1.1000e+0
+string(11) " 1.1000e+0
 "
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.703&r2=1.1247.2.704&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.703 php-src/NEWS:1.1247.2.704
--- php-src/NEWS:1.1247.2.703   Fri Jul 16 01:08:15 2004
+++ php-src/NEWS        Sun Jul 18 13:29:45 2004
@@ -33,6 +33,7 @@
   (Ilia)
 - Fixed bug #28649 (Proper glob() return value on Linux when there are no
   matches). (Ilia)
+- Fixed bug #28633 (sprintf incorrectly adding padding to floats). (Ilia)
 - Fixed bug #28627 (When multiple MySQL links are used default link is leaked).
   (gavin at ipalsoftware dot com, Ilia)
 - Fixed bug #28525 (gmp_powm() does not work with hexadecimal string modulo

http://cvs.php.net/co.php/php-src/ext/standard/tests/strings/bug28633.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/strings/bug28633.phpt
+++ php-src/ext/standard/tests/strings/bug28633.phpt
--TEST--
Bug #28633 (sprintf incorrectly adding padding to floats)
--FILE--
<?php
        echo sprintf("%05.2f", 0.02) . "\n";
        echo sprintf("%05.2f", 2.02) . "\n";
?>
--EXPECT--
00.02
02.02

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

Reply via email to