diff options
Diffstat (limited to 'ext/enchant/enchant.c')
-rw-r--r-- | ext/enchant/enchant.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index 063b419bd3..5f5ad507ae 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -332,14 +332,14 @@ PHP_MINFO_FUNCTION(enchant) #define PHP_ENCHANT_GET_BROKER \ pbroker = (enchant_broker *)zend_fetch_resource(Z_RES_P(broker), "enchant_broker", le_enchant_broker); \ if (!pbroker || !pbroker->pbroker) { \ - php_error_docref(NULL, E_WARNING, "%s", "Resource broker invalid"); \ + php_error_docref(NULL, E_WARNING, "Resource broker invalid"); \ RETURN_FALSE; \ } #define PHP_ENCHANT_GET_DICT \ pdict = (enchant_dict *)zend_fetch_resource(Z_RES_P(dict), "enchant_dict", le_enchant_dict); \ if (!pdict || !pdict->pdict) { \ - php_error_docref(NULL, E_WARNING, "%s", "Invalid dictionary resource."); \ + php_error_docref(NULL, E_WARNING, "Invalid dictionary resource."); \ RETURN_FALSE; \ } @@ -711,13 +711,15 @@ PHP_FUNCTION(enchant_dict_quick_check) size_t wordlen; enchant_dict *pdict; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|z", &dict, &word, &wordlen, &sugg) == FAILURE) { RETURN_FALSE; } if (sugg) { - zval_ptr_dtor(sugg); - array_init(sugg); + sugg = zend_try_array_init(sugg); + if (!sugg) { + return; + } } PHP_ENCHANT_GET_DICT; @@ -919,12 +921,3 @@ PHP_FUNCTION(enchant_dict_describe) enchant_dict_describe(pdict->pdict, describe_dict_fn, (void *)return_value); } /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ |