[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/string.c trunk/ext/standard/string.c

2011-04-13 Thread Felipe Pena
felipe   Wed, 13 Apr 2011 13:38:52 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=310209

Log:
- Remove undesired line (reported by Gökhan Özbulak)

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/standard/string.c
U   php/php-src/trunk/ext/standard/string.c

Modified: php/php-src/branches/PHP_5_3/ext/standard/string.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/string.c  2011-04-13 12:23:46 UTC 
(rev 310208)
+++ php/php-src/branches/PHP_5_3/ext/standard/string.c  2011-04-13 13:38:52 UTC 
(rev 310209)
@@ -2408,8 +2408,6 @@
} else {
l = Z_LVAL_PP(tmp_len);
}
-
-   l = Z_LVAL_PP(tmp_len);

zend_hash_move_forward_ex(Z_ARRVAL_PP(len), pos_len);
} else {
l = Z_STRLEN_P(orig_str);

Modified: php/php-src/trunk/ext/standard/string.c
===
--- php/php-src/trunk/ext/standard/string.c 2011-04-13 12:23:46 UTC (rev 
310208)
+++ php/php-src/trunk/ext/standard/string.c 2011-04-13 13:38:52 UTC (rev 
310209)
@@ -2408,8 +2408,6 @@
} else {
l = Z_LVAL_PP(tmp_len);
}
-
-   l = Z_LVAL_PP(tmp_len);

zend_hash_move_forward_ex(Z_ARRVAL_PP(len), pos_len);
} else {
l = Z_STRLEN_P(orig_str);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/string.c trunk/ext/standard/string.c

2010-08-06 Thread Ilia Alshanetsky
iliaaFri, 06 Aug 2010 19:11:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=301936

Log:
Use correct order of operations. Second of many fixes for bug #52550

Bug: http://bugs.php.net/52550 (Analyzed) integer undefined behaviors executed 
during make test
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/standard/string.c
U   php/php-src/trunk/ext/standard/string.c

Modified: php/php-src/branches/PHP_5_3/ext/standard/string.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/string.c  2010-08-06 18:20:41 UTC 
(rev 301935)
+++ php/php-src/branches/PHP_5_3/ext/standard/string.c  2010-08-06 19:11:34 UTC 
(rev 301936)
@@ -1873,7 +1873,7 @@
p = haystack + offset;
e = haystack + haystack_len - needle_len;
} else {
-   if (-offset  haystack_len || offset  -INT_MAX) {
+   if (offset  -INT_MAX || -offset  haystack_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Offset is 
greater than the length of haystack string);
RETURN_FALSE;
}
@@ -1951,7 +1951,7 @@
e = haystack + haystack_len - 1;
} else {
p = haystack;
-   if (-offset  haystack_len || offset  -INT_MAX) {
+   if (offset  -INT_MAX || -offset  haystack_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Offset is greater than the length of haystack string);
RETURN_FALSE;
}
@@ -1983,7 +1983,7 @@
p = haystack_dup + offset;
e = haystack_dup + haystack_len - needle_len;
} else {
-   if (-offset  haystack_len || offset  -INT_MAX) {
+   if (offset  -INT_MAX || -offset  haystack_len) {
efree(needle_dup);
efree(haystack_dup);
php_error_docref(NULL TSRMLS_CC, E_WARNING, Offset is 
greater than the length of haystack string);

Modified: php/php-src/trunk/ext/standard/string.c
===
--- php/php-src/trunk/ext/standard/string.c 2010-08-06 18:20:41 UTC (rev 
301935)
+++ php/php-src/trunk/ext/standard/string.c 2010-08-06 19:11:34 UTC (rev 
301936)
@@ -1873,7 +1873,7 @@
p = haystack + offset;
e = haystack + haystack_len - needle_len;
} else {
-   if (-offset  haystack_len || offset  -INT_MAX) {
+   if (offset  -INT_MAX || -offset  haystack_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Offset is 
greater than the length of haystack string);
RETURN_FALSE;
}
@@ -1951,7 +1951,7 @@
e = haystack + haystack_len - 1;
} else {
p = haystack;
-   if (-offset  haystack_len || offset  -INT_MAX) {
+   if (offset  -INT_MAX || -offset  haystack_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Offset is greater than the length of haystack string);
RETURN_FALSE;
}
@@ -1983,7 +1983,7 @@
p = haystack_dup + offset;
e = haystack_dup + haystack_len - needle_len;
} else {
-   if (-offset  haystack_len || offset  -INT_MAX) {
+   if (offset  -INT_MAX || -offset  haystack_len) {
efree(needle_dup);
efree(haystack_dup);
php_error_docref(NULL TSRMLS_CC, E_WARNING, Offset is 
greater than the length of haystack string);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/string.c trunk/ext/standard/string.c

2009-11-06 Thread Scott MacVicar
scottmac Fri, 06 Nov 2009 09:02:52 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=290368

Log:
Fix a typo

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/standard/string.c
U   php/php-src/trunk/ext/standard/string.c

Modified: php/php-src/branches/PHP_5_3/ext/standard/string.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/string.c  2009-11-06 06:57:07 UTC 
(rev 290367)
+++ php/php-src/branches/PHP_5_3/ext/standard/string.c  2009-11-06 09:02:52 UTC 
(rev 290368)
@@ -3918,7 +3918,7 @@
tmp = str;
end = str + str_len;

-   /* it is really faster to scan twice and allocate mem once insted 
scanning once
+   /* it is really faster to scan twice and allocate mem once instead of 
scanning once
   and constantly reallocing */
while (tmp  end) {
if (*tmp == '\r') {

Modified: php/php-src/trunk/ext/standard/string.c
===
--- php/php-src/trunk/ext/standard/string.c 2009-11-06 06:57:07 UTC (rev 
290367)
+++ php/php-src/trunk/ext/standard/string.c 2009-11-06 09:02:52 UTC (rev 
290368)
@@ -5830,7 +5830,7 @@

p = str;

-   /* it is really faster to scan twice and allocate mem once insted 
scanning once
+   /* it is really faster to scan twice and allocate mem once instead of 
scanning once
   and constantly reallocing */
if (str_type == IS_UNICODE) {
end.u = p.u + str_len;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php