com php-src: fixed str_pad(): ext/standard/string.c
| From: | Anatol Belski | Date: | Wed, 21 Aug 2013 08:35:40 +0000 |
| Subject: | com php-src: fixed str_pad(): ext/standard/string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73618@lists.php.net to get a copy of this message | ||
Commit: 2d44a04a83ddddd6729be1b841cb84acdfc73948
Author: Anatol Belski <ab@php.net> Wed, 21 Aug 2013 01:35:40 -0700
Parents: d6c59e1d7e706cf56dccddf7ddcf1acfbebf1514
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2d44a04a83ddddd6729be1b841cb84acdfc73948
Log:
fixed str_pad()
Changed paths:
M ext/standard/string.c
Diff:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index ab89b7e..c5680c7 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -5221,7 +5221,7 @@ PHP_FUNCTION(str_pad)
/* If resulting string turns out to be shorter than input string,
we simply copy the input and return. */
- if (pad_length <= 0 || (pad_length - input_len) <= 0) {
+ if (pad_length < 0 || pad_length <= input_len) {
RETURN_STRINGL(input, input_len, 1);
}