File php-5.1.2-string.patch of Package php

--- ext/standard/string.c	2006/01/28 00:14:01	1.445.2.7
+++ ext/standard/string.c	2006/03/13 14:37:10	1.445.2.10
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.445.2.7 2006/01/28 00:14:01 pajoye Exp $ */
+/* $Id: string.c,v 1.445.2.10 2006/03/13 14:37:10 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -237,7 +237,7 @@
 		}
 	}
 	
-	if (((unsigned) start + (unsigned) len) > len1) {
+	if ((start + len) > len1) {
 		len = len1 - start;
 	}
 
@@ -676,12 +676,13 @@
 		/* Multiple character line break or forced cut */
 		if (linelength > 0) {
 			chk = (int)(textlen/linelength + 1);
+			newtext = safe_emalloc(chk, breakcharlen, textlen + 1);
 			alloced = textlen + chk * breakcharlen + 1;
 		} else {
 			chk = textlen;
 			alloced = textlen * (breakcharlen + 1) + 1;
+			newtext = safe_emalloc(textlen, (breakcharlen + 1), 1);
 		}
-		newtext = emalloc(alloced);
 
 		/* now keep track of the actual new text length */
 		newtextlen = 0;
@@ -1166,7 +1167,7 @@
 	if (state == 1) {
 		cend = c;
 	}
-	if (suffix != NULL && sufflen < (cend - comp) &&
+	if (suffix != NULL && sufflen < (uint)(cend - comp) &&
 			memcmp(cend - sufflen, suffix, sufflen) == 0) {
 		cend -= sufflen;
 	}
@@ -1983,7 +1984,7 @@
 		RETURN_FALSE;
 	}
 
-	if (((unsigned) f + (unsigned) l) > Z_STRLEN_PP(str)) {
+	if ((f + l) > Z_STRLEN_PP(str)) {
 		l = Z_STRLEN_PP(str) - f;
 	}
 
@@ -2080,7 +2081,7 @@
 				}
 			}
 
-			if (((unsigned) f + (unsigned) l) > Z_STRLEN_PP(str)) {
+			if ((f + l) > Z_STRLEN_PP(str)) {
 				l = Z_STRLEN_PP(str) - f;
 			}
 			if (Z_TYPE_PP(repl) == IS_ARRAY) {
@@ -2176,7 +2177,7 @@
 				}
 			}
 
-			if (((unsigned) f + (unsigned) l) > Z_STRLEN_PP(tmp_str)) {
+			if ((f + l) > Z_STRLEN_PP(tmp_str)) {
 				l = Z_STRLEN_PP(tmp_str) - f;
 			}
 
@@ -4654,7 +4655,7 @@
 		WRONG_PARAM_COUNT;
 	}
 
-    convert_to_string_ex(arg);
+	convert_to_string_ex(arg);
 	RETVAL_ZVAL(*arg, 1, 0);
 
 	php_strtr(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value), rot13_from, rot13_to, 52);
openSUSE Build Service is sponsored by