diff options
author | Harper Mann <harpermann@users.sourceforge.net> | 2006-07-07 06:36:03 +0000 |
---|---|---|
committer | Harper Mann <harpermann@users.sourceforge.net> | 2006-07-07 06:36:03 +0000 |
commit | 3b9386244655be4ef16729ffad4c1f1171af7262 (patch) | |
tree | aee83dca2f8719e921b3e0d3544f18f355c3e681 /plugins/urlize.c | |
parent | 5f9761ed60091476d9e86bbb0e306776c0823fcb (diff) | |
download | monitoring-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
Diffstat (limited to 'plugins/urlize.c')
-rw-r--r-- | plugins/urlize.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/urlize.c b/plugins/urlize.c index d4d00dd6..5bff4b2f 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); |