summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/utils_cmd.c4
-rw-r--r--plugins/check_snmp.c8
-rw-r--r--plugins/runcmd.c4
3 files changed, 5 insertions, 11 deletions
diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c
index 8b8e5708..34fb3909 100644
--- a/lib/utils_cmd.c
+++ b/lib/utils_cmd.c
@@ -118,10 +118,6 @@ _cmd_open (char *const *argv, int *pfd, int *pfderr)
118 118
119 int i = 0; 119 int i = 0;
120 120
121 /* if no command was passed, return with no error */
122 if (argv == NULL)
123 return -1;
124
125 if (!_cmd_pids) 121 if (!_cmd_pids)
126 CMD_INIT; 122 CMD_INIT;
127 123
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index c425df3c..425bb7b2 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 c1d675d0..102191e4 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);