summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-03-12 13:59:23 (GMT)
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-04-17 22:35:09 (GMT)
commita00c412e7ba1474b32f478daf039d2bdf71f072a (patch)
tree6454bc5012dc534c00b56d09673419d04f5e0e6a
parent41fb615f3de34c3b3a344e74fd9cc24936cd58a6 (diff)
downloadmonitoring-plugins-a00c412e7ba1474b32f478daf039d2bdf71f072a.tar.gz
Fixes for -Wnonnull-compare
-rw-r--r--lib/utils_cmd.c4
-rw-r--r--plugins/runcmd.c4
2 files changed, 0 insertions, 8 deletions
diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c
index 8b8e570..34fb390 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/runcmd.c b/plugins/runcmd.c
index 1bd2ca1..ff1987f 100644
--- a/plugins/runcmd.c
+++ b/plugins/runcmd.c
@@ -114,10 +114,6 @@ np_runcmd_open(const char *cmdstring, int *pfd, int *pfderr)
114 env[0] = strdup("LC_ALL=C"); 114 env[0] = strdup("LC_ALL=C");
115 env[1] = '\0'; 115 env[1] = '\0';
116 116
117 /* if no command was passed, return with no error */
118 if (cmdstring == NULL)
119 return -1;
120
121 /* make copy of command string so strtok() doesn't silently modify it */ 117 /* make copy of command string so strtok() doesn't silently modify it */
122 /* (the calling program may want to access it later) */ 118 /* (the calling program may want to access it later) */
123 cmdlen = strlen(cmdstring); 119 cmdlen = strlen(cmdstring);