From 9d83cefdbf1c48d721bdf4f9b51dc894b1ca18c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 10 Apr 2018 19:34:31 +0200 Subject: php: fix return code of functions config_write_option and config_write_line --- src/plugins/php/weechat-php-api.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/plugins/php') diff --git a/src/plugins/php/weechat-php-api.c b/src/plugins/php/weechat-php-api.c index 521876425..e35724322 100644 --- a/src/plugins/php/weechat-php-api.c +++ b/src/plugins/php/weechat-php-api.c @@ -1577,7 +1577,6 @@ API_FUNC(config_write_option) zend_string *z_config_file, *z_option; struct t_config_file *config_file; struct t_config_option *option; - int result; API_INIT_FUNC(1, "config_write_option", API_RETURN_ERROR); if (zend_parse_parameters (ZEND_NUM_ARGS(), @@ -1586,9 +1585,10 @@ API_FUNC(config_write_option) config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file)); option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option)); - result = weechat_config_write_option (config_file, option); - API_RETURN_INT(result); + weechat_config_write_option (config_file, option); + + API_RETURN_OK; } API_FUNC(config_write_line) @@ -1596,7 +1596,6 @@ API_FUNC(config_write_line) zend_string *z_config_file, *z_option_name, *z_value; struct t_config_file *config_file; char *option_name, *value; - int result; API_INIT_FUNC(1, "config_write_line", API_RETURN_ERROR); if (zend_parse_parameters (ZEND_NUM_ARGS(), @@ -1607,11 +1606,12 @@ API_FUNC(config_write_line) config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file)); option_name = ZSTR_VAL(z_option_name); value = ZSTR_VAL(z_value); - result = weechat_config_write_line (config_file, - (const char *)option_name, - (const char *)value); - API_RETURN_INT(result); + weechat_config_write_line (config_file, + (const char *)option_name, + (const char *)value); + + API_RETURN_OK; } API_FUNC(config_write) -- cgit v1.2.3