jani Mon Jul 23 13:27:34 2007 UTC Modified files: /php-src/ext/standard string.c /php-src/ext/standard/tests/strings str_pad.phpt Log: - Fixed str_pad() when passed huge negative pad_length http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.649&r2=1.650&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.649 php-src/ext/standard/string.c:1.650 --- php-src/ext/standard/string.c:1.649 Mon Jul 23 11:47:44 2007 +++ php-src/ext/standard/string.c Mon Jul 23 13:27:34 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.649 2007/07/23 11:47:44 jani Exp $ */ +/* $Id: string.c,v 1.650 2007/07/23 13:27:34 jani Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -7309,7 +7309,7 @@ } /* If resulting string turns out to be shorter than input string, we simply copy the input and return. */ - if (num_pad_chars < 0) { + if (pad_length < 0 || num_pad_chars < 0) { if (input_type == IS_UNICODE) { RETURN_UNICODEL((UChar *)input, input_len, 1); } else { http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/str_pad.phpt?r1=1.4&r2=1.5&diff_format=u Index: php-src/ext/standard/tests/strings/str_pad.phpt
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php