Fixes for Waddress

* check_snmp: Fix string comparison
This commit is contained in:
RincewindsHat 2023-03-12 14:04:25 +01:00
parent a00c412e7b
commit 6d341c40ab

View file

@ -422,7 +422,8 @@ main (int argc, char **argv)
}
else if (strstr (response, "INTEGER: ")) {
show = multiply (strstr (response, "INTEGER: ") + 9);
if (fmtstr != "") {
if (strcmp(fmtstr, "") != 0) {
conv = fmtstr;
}
}
@ -596,8 +597,9 @@ main (int argc, char **argv)
len = sizeof(perfstr)-strlen(perfstr)-1;
strncat(perfstr, show, len>ptr-show ? ptr-show : len);
if (type)
if (strcmp(type, "") != 0) {
strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);
}
if (warning_thresholds) {
strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1);
@ -1185,7 +1187,7 @@ multiply (char *str)
if(verbose>2)
printf(" multiply extracted double: %f\n", val);
val *= multiplier;
if (fmtstr != "") {
if (strcmp(fmtstr, "") != 0) {
conv = fmtstr;
}
if (val == (int)val) {