diff options
author | Subhendu Ghosh <sghosh@users.sourceforge.net> | 2002-11-11 22:15:55 (GMT) |
---|---|---|
committer | Subhendu Ghosh <sghosh@users.sourceforge.net> | 2002-11-11 22:15:55 (GMT) |
commit | fb38088231efc4fc87308f54713ab91f33378c90 (patch) | |
tree | 6a6579cefb28aeebe60fd71d94deec558d927bc7 | |
parent | fd59a578f5847c4d52ebab5d2a073c280f4a4b8c (diff) | |
download | monitoring-plugins-fb38088231efc4fc87308f54713ab91f33378c90.tar.gz |
should use asprintf
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@187 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r-- | plugins/check_snmp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 80366b8..a8ee06f 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
@@ -35,8 +35,8 @@ | |||
35 | [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\ | 35 | [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\ |
36 | [-l label] [-u units] [-p port-number] [-d delimiter]\n\ | 36 | [-l label] [-u units] [-p port-number] [-d delimiter]\n\ |
37 | [-D output-delimiter] [-m miblist] [-P snmp version]\n\ | 37 | [-D output-delimiter] [-m miblist] [-P snmp version]\n\ |
38 | [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\ | 38 | [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\ |
39 | [-X privpasswd]\n" | 39 | [-X privpasswd]\n" |
40 | 40 | ||
41 | #define LONGOPTIONS "\ | 41 | #define LONGOPTIONS "\ |
42 | -H, --hostname=HOST\n\ | 42 | -H, --hostname=HOST\n\ |
@@ -726,7 +726,7 @@ validate_arguments () | |||
726 | asprintf(&proto, "%s", "3"); | 726 | asprintf(&proto, "%s", "3"); |
727 | 727 | ||
728 | if ( (strcmp(seclevel, "noAuthNoPriv") == 0) || seclevel == NULL ) { | 728 | if ( (strcmp(seclevel, "noAuthNoPriv") == 0) || seclevel == NULL ) { |
729 | authpriv = ssprintf(authpriv, "%s", "-l noAuthNoPriv" ); | 729 | asprintf(&authpriv, "%s", "-l noAuthNoPriv" ); |
730 | } | 730 | } |
731 | else if ( strcmp(seclevel, "authNoPriv") == 0 ) { | 731 | else if ( strcmp(seclevel, "authNoPriv") == 0 ) { |
732 | if ( secname == NULL || authpasswd == NULL) { | 732 | if ( secname == NULL || authpasswd == NULL) { |
@@ -734,7 +734,7 @@ validate_arguments () | |||
734 | print_usage (); | 734 | print_usage (); |
735 | exit (STATE_UNKNOWN); | 735 | exit (STATE_UNKNOWN); |
736 | } | 736 | } |
737 | authpriv = ssprintf(authpriv, "-l authNoPriv -a %s -u %s -A %s ", authproto, secname, authpasswd); | 737 | asprintf(&authpriv, "-l authNoPriv -a %s -u %s -A %s ", authproto, secname, authpasswd); |
738 | } | 738 | } |
739 | else if ( strcmp(seclevel, "authPriv") == 0 ) { | 739 | else if ( strcmp(seclevel, "authPriv") == 0 ) { |
740 | if ( secname == NULL || authpasswd == NULL || privpasswd == NULL ) { | 740 | if ( secname == NULL || authpasswd == NULL || privpasswd == NULL ) { |
@@ -742,7 +742,7 @@ validate_arguments () | |||
742 | print_usage (); | 742 | print_usage (); |
743 | exit (STATE_UNKNOWN); | 743 | exit (STATE_UNKNOWN); |
744 | } | 744 | } |
745 | authpriv = ssprintf(authpriv, "-l authPriv -a %s -u %s -A %s -x DES -X %s ", authproto, secname, authpasswd, privpasswd); | 745 | asprintf(&authpriv, "-l authPriv -a %s -u %s -A %s -x DES -X %s ", authproto, secname, authpasswd, privpasswd); |
746 | } | 746 | } |
747 | 747 | ||
748 | 748 | ||