diff options
| author | Nikita Popov <nikic@php.net> | 2014-09-05 12:44:51 +0200 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2014-09-05 12:45:42 +0200 |
| commit | 828fe353817c78cec2ceb7c42ff0644069f46ba7 (patch) | |
| tree | aca98b0da2d90cb64c3c552d6289e781d1aed1fb /Zend/zend_operators.c | |
| parent | 9a420f0361243e0aa42f93fd996c8f2f133c20cc (diff) | |
| download | php-git-828fe353817c78cec2ceb7c42ff0644069f46ba7.tar.gz | |
Fix string increment
Diffstat (limited to 'Zend/zend_operators.c')
| -rw-r--r-- | Zend/zend_operators.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index e4fdaa6f9e..2e48c154e9 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -2023,7 +2023,7 @@ static void increment_string(zval *str) /* {{{ */ } s = Z_STRVAL_P(str); - while (pos >= 0) { + do { ch = s[pos]; if (ch >= 'a' && ch <= 'z') { if (ch == 'z') { @@ -2059,8 +2059,7 @@ static void increment_string(zval *str) /* {{{ */ if (carry == 0) { break; } - pos--; - } + } while (pos-- > 0); if (carry) { t = zend_string_alloc(Z_STRLEN_P(str)+1, 0); |
