summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_snmp.c8
-rw-r--r--plugins/runcmd.c4
2 files changed, 5 insertions, 7 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index c425df3..425bb7b 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -422,7 +422,8 @@ main (int argc, char **argv)
422 } 422 }
423 else if (strstr (response, "INTEGER: ")) { 423 else if (strstr (response, "INTEGER: ")) {
424 show = multiply (strstr (response, "INTEGER: ") + 9); 424 show = multiply (strstr (response, "INTEGER: ") + 9);
425 if (fmtstr != "") { 425
426 if (strcmp(fmtstr, "") != 0) {
426 conv = fmtstr; 427 conv = fmtstr;
427 } 428 }
428 } 429 }
@@ -596,8 +597,9 @@ main (int argc, char **argv)
596 len = sizeof(perfstr)-strlen(perfstr)-1; 597 len = sizeof(perfstr)-strlen(perfstr)-1;
597 strncat(perfstr, show, len>ptr-show ? ptr-show : len); 598 strncat(perfstr, show, len>ptr-show ? ptr-show : len);
598 599
599 if (type) 600 if (strcmp(type, "") != 0) {
600 strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1); 601 strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);
602 }
601 603
602 if (warning_thresholds) { 604 if (warning_thresholds) {
603 strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1); 605 strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1);
@@ -1185,7 +1187,7 @@ multiply (char *str)
1185 if(verbose>2) 1187 if(verbose>2)
1186 printf(" multiply extracted double: %f\n", val); 1188 printf(" multiply extracted double: %f\n", val);
1187 val *= multiplier; 1189 val *= multiplier;
1188 if (fmtstr != "") { 1190 if (strcmp(fmtstr, "") != 0) {
1189 conv = fmtstr; 1191 conv = fmtstr;
1190 } 1192 }
1191 if (val == (int)val) { 1193 if (val == (int)val) {
diff --git a/plugins/runcmd.c b/plugins/runcmd.c
index c1d675d..102191e 100644
--- a/plugins/runcmd.c
+++ b/plugins/runcmd.c
@@ -116,10 +116,6 @@ np_runcmd_open(const char *cmdstring, int *pfd, int *pfderr)
116 env[0] = strdup("LC_ALL=C"); 116 env[0] = strdup("LC_ALL=C");
117 env[1] = '\0'; 117 env[1] = '\0';
118 118
119 /* if no command was passed, return with no error */
120 if (cmdstring == NULL)
121 return -1;
122
123 /* make copy of command string so strtok() doesn't silently modify it */ 119 /* make copy of command string so strtok() doesn't silently modify it */
124 /* (the calling program may want to access it later) */ 120 /* (the calling program may want to access it later) */
125 cmdlen = strlen(cmdstring); 121 cmdlen = strlen(cmdstring);