ID: 22922 Updated by: [EMAIL PROTECTED] Reported By: y dot leconte dot akis at nerim dot fr -Status: Open +Status: Bogus -Bug Type: Output Control +Bug Type: Strings related Operating System: Linux PHP Version: 4.3.1 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip Actually dupe of bug #22224 Previous Comments: ------------------------------------------------------------------------ [2003-03-27 05:27:40] y dot leconte dot akis at nerim dot fr Hello. I find a problem in the sprintf function when i try to format a string. example: <? $out=sprintf("%4.4s","123456789"); echo strlen($out)." - $out<BR>"; ?> result: 9 - 123456789 instead of 4 - 1234 Formats %xs and %.ys work but not format like %x.ys where x and y are numbers. The problem seems to come from the php_sprintf_appendstring function located in the ext/standard/formatted_print.c file. Putting in comment the following lines: /* if (max_width && min_width) { expprec = max_width = 0; } */ seems to resolve the problem. But i dont know the possible impacts of this modification on others zend functions. Best regards Yves ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22922&edit=1