From 9ab8deb33cd39e45e0bf7419b44519eecb73e8c6 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Tue, 25 Jan 2005 23:58:22 +0000 Subject: [PATCH] Don't depend on empty_string. --- ext/standard/browscap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 77534f410ce..6385fab4fec 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -39,7 +39,7 @@ static void browscap_entry_dtor(zval **pvalue) zend_hash_destroy(Z_ARRVAL_PP(pvalue)); free(Z_ARRVAL_PP(pvalue)); } else if (Z_TYPE_PP(pvalue) == IS_STRING) { - if (Z_STRVAL_PP(pvalue) && Z_STRVAL_PP(pvalue) != empty_string) { + if (Z_STRVAL_PP(pvalue)) { free(Z_STRVAL_PP(pvalue)); } } @@ -102,7 +102,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, int callback_type, vo new_property = (zval *) malloc(sizeof(zval)); INIT_PZVAL(new_property); - Z_STRVAL_P(new_property) = Z_STRLEN_P(arg2)?zend_strndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)):empty_string; + Z_STRVAL_P(new_property) = zend_strndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)); Z_STRLEN_P(new_property) = Z_STRLEN_P(arg2); Z_TYPE_P(new_property) = IS_STRING;