From 24bef50ab259b9215b933944a2cf2764b5d7a100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 10 Sep 2017 20:51:42 +0200 Subject: [PATCH] php: fix function plugin_get_name --- src/plugins/php/weechat-php-api.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/php/weechat-php-api.c b/src/plugins/php/weechat-php-api.c index c79a1fef5..ed368f307 100644 --- a/src/plugins/php/weechat-php-api.c +++ b/src/plugins/php/weechat-php-api.c @@ -229,13 +229,17 @@ weechat_php_cb_err: API_FUNC(plugin_get_name) { + zend_string *z_plugin; + struct t_weechat_plugin *plugin; const char *retval; API_INIT_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); - if (zend_parse_parameters_none () == FAILURE) + if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_plugin) == FAILURE) API_WRONG_ARGS(API_RETURN_EMPTY); - retval = weechat_plugin_get_name (weechat_php_plugin); + plugin = API_STR2PTR(ZSTR_VAL(z_plugin)); + + retval = weechat_plugin_get_name (plugin); API_RETURN_STRING(retval); }