From: Harper Mann Date: Fri, 7 Jul 2006 06:36:03 +0000 (+0000) Subject: Added check for two arguments. Was segfaulting if no or one arg. Now returns X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3b9386244655be4ef16729ffad4c1f1171af7262;p=nagiosplug.git Added check for two arguments. Was segfaulting if no or one arg. Now returns help. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1444 f882894a-f735-0410-b71e-b25c423dba1c --- diff --git a/plugins/urlize.c b/plugins/urlize.c index d4d00dd..5bff4b2 100644 --- a/plugins/urlize.c +++ b/plugins/urlize.c @@ -56,6 +56,12 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + /* Need at least 2 args */ + if (argc < 3) { + print_help(); + exit (STATE_UNKNOWN); + } + while (1) { c = getopt_long (argc, argv, "+hVu:", longopts, &option);