summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarper Mann <harpermann@users.sourceforge.net>2006-07-07 06:36:03 (GMT)
committerHarper Mann <harpermann@users.sourceforge.net>2006-07-07 06:36:03 (GMT)
commit3b9386244655be4ef16729ffad4c1f1171af7262 (patch)
treeaee83dca2f8719e921b3e0d3544f18f355c3e681
parent5f9761ed60091476d9e86bbb0e306776c0823fcb (diff)
downloadmonitoring-plugins-3b9386244655be4ef16729ffad4c1f1171af7262.tar.gz
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
-rw-r--r--plugins/urlize.c6
1 files changed, 6 insertions, 0 deletions
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)
56 bindtextdomain (PACKAGE, LOCALEDIR); 56 bindtextdomain (PACKAGE, LOCALEDIR);
57 textdomain (PACKAGE); 57 textdomain (PACKAGE);
58 58
59 /* Need at least 2 args */
60 if (argc < 3) {
61 print_help();
62 exit (STATE_UNKNOWN);
63 }
64
59 while (1) { 65 while (1) {
60 c = getopt_long (argc, argv, "+hVu:", longopts, &option); 66 c = getopt_long (argc, argv, "+hVu:", longopts, &option);
61 67