summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b39ae71)
raw | patch | inline | side by side (parent: b39ae71)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Fri, 8 Nov 2002 08:07:37 +0000 (08:07 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Fri, 8 Nov 2002 08:07:37 +0000 (08:07 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@176 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_snmp.c | patch | blob | history |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 4a51a2945bdc4d18cb8eaaf712791955a1f6303b..de019bac0e93133b772d6de0e09985368d76d520 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
strcpy (argv[c], "-c");
}
- /* initialize some args */
- asprintf (&oid, "");
-
while (1) {
#ifdef HAVE_GETOPT_H
c =
ptr[0] = ' '; /* relpace comma with space */
for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++)
eval_method[++j] |= WARN_PRESENT;
- asprintf (&oid, "%s %s", oid, optarg);
+ asprintf (&oid, "%s %s", (oid?oid:""), optarg);
break;
case 'E': /* PRELIMINARY - may change */
eval_method[j] |= WARN_PRESENT;
ptr[0] = ' '; /* relpace comma with space */
for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++)
eval_method[++j] |= CRIT_PRESENT;
- asprintf (&oid, "%s %s", oid, optarg);
+ asprintf (&oid, "%s %s", (oid?oid:""), optarg);
break;
case 'c': /* critical time threshold */
if (strspn (optarg, "0123456789:,") < strlen (optarg)) {
case 'o': /* object identifier */
for (ptr = optarg; (ptr = index (ptr, ',')); ptr++)
ptr[0] = ' '; /* relpace comma with space */
- for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++) {
+ for (ptr = optarg; (ptr = index (ptr, ' ')); ptr++)
j++; /* count OIDs */
- }
- asprintf (&oid, "%s %s", oid, optarg);
+ asprintf (&oid, "%s %s", (oid?oid:""), optarg);
break;
case 'd': /* delimiter */
delimiter = strscpy (delimiter, optarg);