diff options
| author | Antony Dovgal <tony2001@php.net> | 2006-08-31 14:21:21 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2006-08-31 14:21:21 +0000 |
| commit | 0c482b5c64f9831a6aea19fe463014afffc37def (patch) | |
| tree | 1c35dca7d61ba657e7e69e9ef53fa65c0074adea /ext/standard/string.c | |
| parent | de23f39d1860e0a0350d4a4c1c3881d37e63feab (diff) | |
| download | php-git-0c482b5c64f9831a6aea19fe463014afffc37def.tar.gz | |
more z/Z fixes
Diffstat (limited to 'ext/standard/string.c')
| -rw-r--r-- | ext/standard/string.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 2de5d03a4f..4ce916715a 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1741,22 +1741,22 @@ PHP_FUNCTION(stripos) Finds position of last occurrence of a string within another string */ PHP_FUNCTION(strrpos) { - zval *zneedle; + zval **zneedle; char *needle, *haystack; int needle_len, haystack_len; long offset = 0; char *p, *e, ord_needle[2]; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &haystack, &haystack_len, &zneedle, &offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ|l", &haystack, &haystack_len, &zneedle, &offset) == FAILURE) { RETURN_FALSE; } - if (Z_TYPE_P(zneedle) == IS_STRING) { - needle = Z_STRVAL_P(zneedle); - needle_len = Z_STRLEN_P(zneedle); + if (Z_TYPE_PP(zneedle) == IS_STRING) { + needle = Z_STRVAL_PP(zneedle); + needle_len = Z_STRLEN_PP(zneedle); } else { - convert_to_long(zneedle); - ord_needle[0] = (char)(Z_LVAL_P(zneedle) & 0xFF); + convert_to_long_ex(zneedle); + ord_needle[0] = (char)(Z_LVAL_PP(zneedle) & 0xFF); ord_needle[1] = '\0'; needle = ord_needle; needle_len = 1; @@ -1806,23 +1806,23 @@ PHP_FUNCTION(strrpos) Finds position of last occurrence of a string within another string */ PHP_FUNCTION(strripos) { - zval *zneedle; + zval **zneedle; char *needle, *haystack; int needle_len, haystack_len; long offset = 0; char *p, *e, ord_needle[2]; char *needle_dup, *haystack_dup; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz|l", &haystack, &haystack_len, &zneedle, &offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ|l", &haystack, &haystack_len, &zneedle, &offset) == FAILURE) { RETURN_FALSE; } - if (Z_TYPE_P(zneedle) == IS_STRING) { - needle = Z_STRVAL_P(zneedle); - needle_len = Z_STRLEN_P(zneedle); + if (Z_TYPE_PP(zneedle) == IS_STRING) { + needle = Z_STRVAL_PP(zneedle); + needle_len = Z_STRLEN_PP(zneedle); } else { - convert_to_long(zneedle); - ord_needle[0] = (char)(Z_LVAL_P(zneedle) & 0xFF); + convert_to_long_ex(zneedle); + ord_needle[0] = (char)(Z_LVAL_PP(zneedle) & 0xFF); ord_needle[1] = '\0'; needle = ord_needle; needle_len = 1; |
