From: Stanislav Malyshev Date: Mon, 8 Jan 2001 20:13:32 +0000 (+0000) Subject: Optimize it a bit - no need to dup empty string (which can be pretty common for ... X-Git-Tag: php-4.0.5RC1~665 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b06323cd6e452d15b78ab4e851acfabff607ce94;p=php Optimize it a bit - no need to dup empty string (which can be pretty common for .ini) --- diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 9383eada28..04be7ea245 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -92,7 +92,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); - new_property->value.str.val = zend_strndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)); + new_property->value.str.val = Z_STRLEN_P(arg2)?zend_strndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)):""; new_property->value.str.len = Z_STRLEN_P(arg2); new_property->type = IS_STRING;