|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-03-27 05:49 UTC] moriyoshi@php.net
[2003-03-27 05:50 UTC] moriyoshi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 18:00:01 2025 UTC |
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