summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b4ac701)
raw | patch | inline | side by side (parent: b4ac701)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Fri, 20 Oct 2006 07:53:31 +0000 (07:53 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Fri, 20 Oct 2006 07:53:31 +0000 (07:53 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1513 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 7ba968472ff6bd84e20e62adccda68140ec11ce5..1e1657b4f91651ce02fb30baa60e5715b14ae781 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
regex_t preg;
regmatch_t pmatch[10];
char timestamp[10] = "";
-char errbuf[MAX_INPUT_BUFFER];
-char perfstr[MAX_INPUT_BUFFER];
+char errbuf[MAX_INPUT_BUFFER] = "";
+char perfstr[MAX_INPUT_BUFFER] = "";
int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
int eflags = 0;
int errcode, excode;
char *ptr = NULL;
char *p2 = NULL;
char *show = NULL;
- char type[8];
- char *str[MAX_INPUT_BUFFER];
+ char type[8] = "";
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
}
/* We strip out the datatype indicator for PHBs */
+
+ /* Clean up type array - Sol10 does not necessarily zero it out */
+ bzero(type, sizeof(type));
+
if (strstr (response, "Gauge: "))
show = strstr (response, "Gauge: ") + 7;
else if (strstr (response, "Gauge32: "))
i++;
- asprintf(str, "=%s%s;;;; ", show, type ? type : "");
- strcat(perfstr, *str);
+ strcat(perfstr, "=");
+ strcat(perfstr, show);
+ if (type)
+ strcat(perfstr, type);
+ strcat(perfstr, " ");
} /* end while (ptr) */