From 7fa0970567054097edec1e2b95a47f0b51bd9afe Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Sat, 11 Jan 2003 23:05:19 +0000 Subject: [PATCH] Reverted because correct decision has not been made yet. --- ext/ereg/ereg.c | 2 +- ext/standard/browscap.c | 6 +++--- ext/standard/datetime.c | 8 ++++---- ext/standard/file.c | 4 ++-- ext/standard/formatted_print.c | 2 +- ext/standard/pack.c | 4 ++-- ext/standard/reg.c | 2 +- ext/standard/string.c | 20 ++++++++++---------- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index 2f1740e2817..791b215d2fc 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -605,7 +605,7 @@ PHPAPI PHP_FUNCTION(sql_regcase) tmp = emalloc((Z_STRLEN_PP(string) * 4) + 1); - for (i = j = 0; i < (int)Z_STRLEN_PP(string); i++) { + for (i = j = 0; i < Z_STRLEN_PP(string); i++) { c = (unsigned char) Z_STRVAL_PP(string)[i]; if(isalpha(c)) { tmp[j++] = '['; diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 8118095b844..b2d50d50323 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -49,20 +49,20 @@ static void convert_browscap_pattern(zval *pattern) register int i, j; char *t; - for (i = 0; i < (int)Z_STRLEN_P(pattern); i++) { + for (i=0; i 1 && (int)Z_STRLEN_P(return_value) < len / 2) { + if (argc > 1 && Z_STRLEN_P(return_value) < len / 2) { Z_STRVAL_P(return_value) = erealloc(buf, line_len + 1); } } @@ -1559,7 +1559,7 @@ PHPAPI PHP_FUNCTION(fwrite) } convert_to_string_ex(arg2); convert_to_long_ex(arg3); - num_bytes = MIN(Z_LVAL_PP(arg3), (int)Z_STRLEN_PP(arg2)); + num_bytes = MIN(Z_LVAL_PP(arg3), Z_STRLEN_PP(arg2)); break; default: WRONG_PARAM_COUNT; diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 47cc4716087..d5bd95c4b79 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -504,7 +504,7 @@ php_formatted_print(int ht, int *len, int use_array, int format_offset TSRMLS_DC currarg = 1; - while (inpos < (int)Z_STRLEN_PP(args[format_offset])) { + while (inpos (int)Z_STRLEN_PP(val)) { + if(arg > Z_STRLEN_PP(val)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough characters in string", code); arg = Z_STRLEN_PP(val); } diff --git a/ext/standard/reg.c b/ext/standard/reg.c index 2f1740e2817..791b215d2fc 100644 --- a/ext/standard/reg.c +++ b/ext/standard/reg.c @@ -605,7 +605,7 @@ PHPAPI PHP_FUNCTION(sql_regcase) tmp = emalloc((Z_STRLEN_PP(string) * 4) + 1); - for (i = j = 0; i < (int)Z_STRLEN_PP(string); i++) { + for (i = j = 0; i < Z_STRLEN_PP(string); i++) { c = (unsigned char) Z_STRVAL_PP(string)[i]; if(isalpha(c)) { tmp[j++] = '['; diff --git a/ext/standard/string.c b/ext/standard/string.c index 5b87657566e..65b995de863 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1557,7 +1557,7 @@ PHP_FUNCTION(strrpos) if (argc == 3) { convert_to_long_ex(offset); - if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) > (int)Z_STRLEN_PP(haystack)) { + if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) > Z_STRLEN_PP(haystack)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string."); RETURN_FALSE; } @@ -1597,7 +1597,7 @@ PHP_FUNCTION(strripos) if (argc == 3) { convert_to_long_ex(offset); - if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) > (int)Z_STRLEN_PP(haystack)) { + if (Z_LVAL_PP(offset) < 0 || Z_LVAL_PP(offset) > Z_STRLEN_PP(haystack)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string."); RETURN_FALSE; } @@ -1786,11 +1786,11 @@ PHP_FUNCTION(substr) } } - if (f >= (int)Z_STRLEN_PP(str)) { + if (f >= Z_STRLEN_PP(str)) { RETURN_FALSE; } - if ((f + l) > (int)Z_STRLEN_PP(str)) { + if ((f + l) > Z_STRLEN_PP(str)) { l = Z_STRLEN_PP(str) - f; } @@ -1833,11 +1833,11 @@ PHP_FUNCTION(substr_replace) * of the string */ if (f < 0) { - f = (int)Z_STRLEN_PP(str) + f; + f = Z_STRLEN_PP(str) + f; if (f < 0) { f = 0; } - } else if (f > (int)Z_STRLEN_PP(str)) { + } else if (f > Z_STRLEN_PP(str)) { f = Z_STRLEN_PP(str); } @@ -1852,7 +1852,7 @@ PHP_FUNCTION(substr_replace) } } - if ((f + l) > (int)Z_STRLEN_PP(str)) { + if ((f + l) > Z_STRLEN_PP(str)) { l = Z_STRLEN_PP(str) - f; } @@ -3014,7 +3014,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines) do { if (block_type == _HEB_BLOCK_TYPE_HEB) { - while ((isheb((int)*(tmp+1)) || _isblank((int)*(tmp+1)) || ispunct((int)*(tmp+1)) || (int)*(tmp+1)=='\n' ) && block_end<((int)Z_STRLEN_PP(str))-1) { + while ((isheb((int)*(tmp+1)) || _isblank((int)*(tmp+1)) || ispunct((int)*(tmp+1)) || (int)*(tmp+1)=='\n' ) && block_end