From 78c110ace288496b837bc08580c5cff8b562b7e3 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 6 Nov 2005 22:12:40 +0000 Subject: [PATCH] Check only min number of args in perl plugin for all functions, except register (if too much args given, they're silently ignored) --- src/plugins/scripts/perl/weechat-perl.c | 20 +++++++++---------- .../src/plugins/scripts/perl/weechat-perl.c | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index 4522805d6..c7a5383e2 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -268,7 +268,7 @@ static XS (XS_weechat_print) XSRETURN_NO; } - if ((items < 1) || (items > 3)) + if (items < 1) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -315,7 +315,7 @@ static XS (XS_weechat_print_infobar) XSRETURN_NO; } - if (items != 2) + if (items < 2) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -351,7 +351,7 @@ static XS (XS_weechat_command) XSRETURN_NO; } - if ((items < 1) || (items > 3)) + if (items < 1) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -397,7 +397,7 @@ static XS (XS_weechat_add_message_handler) XSRETURN_NO; } - if (items != 2) + if (items < 2) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -485,7 +485,7 @@ static XS (XS_weechat_remove_handler) XSRETURN_NO; } - if (items != 2) + if (items < 2) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -523,7 +523,7 @@ static XS (XS_weechat_get_info) XSRETURN_NO; } - if ((items < 1) || (items > 2)) + if (items < 1) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -629,7 +629,7 @@ static XS (XS_weechat_get_config) XSRETURN_NO; } - if (items != 1) + if (items < 1) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -676,7 +676,7 @@ static XS (XS_weechat_set_config) XSRETURN_NO; } - if (items != 2) + if (items < 2) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -717,7 +717,7 @@ static XS (XS_weechat_get_plugin_config) XSRETURN_NO; } - if (items != 1) + if (items < 1) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -766,7 +766,7 @@ static XS (XS_weechat_set_plugin_config) XSRETURN_NO; } - if (items != 2) + if (items < 2) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " diff --git a/weechat/src/plugins/scripts/perl/weechat-perl.c b/weechat/src/plugins/scripts/perl/weechat-perl.c index 4522805d6..c7a5383e2 100644 --- a/weechat/src/plugins/scripts/perl/weechat-perl.c +++ b/weechat/src/plugins/scripts/perl/weechat-perl.c @@ -268,7 +268,7 @@ static XS (XS_weechat_print) XSRETURN_NO; } - if ((items < 1) || (items > 3)) + if (items < 1) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -315,7 +315,7 @@ static XS (XS_weechat_print_infobar) XSRETURN_NO; } - if (items != 2) + if (items < 2) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -351,7 +351,7 @@ static XS (XS_weechat_command) XSRETURN_NO; } - if ((items < 1) || (items > 3)) + if (items < 1) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -397,7 +397,7 @@ static XS (XS_weechat_add_message_handler) XSRETURN_NO; } - if (items != 2) + if (items < 2) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -485,7 +485,7 @@ static XS (XS_weechat_remove_handler) XSRETURN_NO; } - if (items != 2) + if (items < 2) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -523,7 +523,7 @@ static XS (XS_weechat_get_info) XSRETURN_NO; } - if ((items < 1) || (items > 2)) + if (items < 1) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -629,7 +629,7 @@ static XS (XS_weechat_get_config) XSRETURN_NO; } - if (items != 1) + if (items < 1) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -676,7 +676,7 @@ static XS (XS_weechat_set_config) XSRETURN_NO; } - if (items != 2) + if (items < 2) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -717,7 +717,7 @@ static XS (XS_weechat_get_plugin_config) XSRETURN_NO; } - if (items != 1) + if (items < 1) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for " @@ -766,7 +766,7 @@ static XS (XS_weechat_set_plugin_config) XSRETURN_NO; } - if (items != 2) + if (items < 2) { perl_plugin->printf_server (perl_plugin, "Perl error: wrong parameters for "