summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-15 22:44:08 (GMT)
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-15 22:45:33 (GMT)
commit6972242126f1dbfb929dbd1c1582d973d2094d8a (patch)
treec1b1505036fdb00baba0cc17b68f46a085d17be2
parent15b4e89a42a3caf2c4da3992d698b356649665a1 (diff)
downloadmonitoring-plugins-6972242126f1dbfb929dbd1c1582d973d2094d8a.tar.gz
Fixes for compiler warning -Wparenthesesrefs/pull/1939/head
-rw-r--r--lib/extra_opts.c4
-rw-r--r--lib/utils_base.c4
-rw-r--r--plugins/check_http.c2
-rw-r--r--plugins/check_procs.c5
4 files changed, 8 insertions, 7 deletions
diff --git a/lib/extra_opts.c b/lib/extra_opts.c
index b9843eb..771621d 100644
--- a/lib/extra_opts.c
+++ b/lib/extra_opts.c
@@ -92,14 +92,14 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){
92 /* append the list to extra_args */ 92 /* append the list to extra_args */
93 if(extra_args==NULL){ 93 if(extra_args==NULL){
94 extra_args=ea1; 94 extra_args=ea1;
95 while(ea1=ea1->next) ea_num++; 95 while((ea1 = ea1->next)) ea_num++;
96 }else{ 96 }else{
97 ea_tmp=extra_args; 97 ea_tmp=extra_args;
98 while(ea_tmp->next) { 98 while(ea_tmp->next) {
99 ea_tmp=ea_tmp->next; 99 ea_tmp=ea_tmp->next;
100 } 100 }
101 ea_tmp->next=ea1; 101 ea_tmp->next=ea1;
102 while(ea1=ea1->next) ea_num++; 102 while((ea1 = ea1->next)) ea_num++;
103 } 103 }
104 ea1=ea_tmp=NULL; 104 ea1=ea_tmp=NULL;
105 } 105 }
diff --git a/lib/utils_base.c b/lib/utils_base.c
index 3c7221c..f86efbe 100644
--- a/lib/utils_base.c
+++ b/lib/utils_base.c
@@ -331,7 +331,7 @@ char *np_extract_value(const char *varlist, const char *name, char sep) {
331 /* strip leading spaces */ 331 /* strip leading spaces */
332 for (; isspace(varlist[0]); varlist++); 332 for (; isspace(varlist[0]); varlist++);
333 333
334 if (tmp = index(varlist, sep)) { 334 if ((tmp = index(varlist, sep))) {
335 /* Value is delimited by a comma */ 335 /* Value is delimited by a comma */
336 if (tmp-varlist == 0) continue; 336 if (tmp-varlist == 0) continue;
337 value = (char *)calloc(1, tmp-varlist+1); 337 value = (char *)calloc(1, tmp-varlist+1);
@@ -347,7 +347,7 @@ char *np_extract_value(const char *varlist, const char *name, char sep) {
347 break; 347 break;
348 } 348 }
349 } 349 }
350 if (tmp = index(varlist, sep)) { 350 if ((tmp = index(varlist, sep))) {
351 /* More keys, keep going... */ 351 /* More keys, keep going... */
352 varlist = tmp + 1; 352 varlist = tmp + 1;
353 } else { 353 } else {
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 718c8ee..b9d8145 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1094,7 +1094,7 @@ check_http (void)
1094 microsec_firstbyte = deltime (tv_temp); 1094 microsec_firstbyte = deltime (tv_temp);
1095 elapsed_time_firstbyte = (double)microsec_firstbyte / 1.0e6; 1095 elapsed_time_firstbyte = (double)microsec_firstbyte / 1.0e6;
1096 } 1096 }
1097 while (pos = memchr(buffer, '\0', i)) { 1097 while ((pos = memchr(buffer, '\0', i))) {
1098 /* replace nul character with a blank */ 1098 /* replace nul character with a blank */
1099 *pos = ' '; 1099 *pos = ' ';
1100 } 1100 }
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index c17c699..1637e3e 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -241,8 +241,9 @@ main (int argc, char **argv)
241 241
242 /* Ignore self */ 242 /* Ignore self */
243 if ((usepid && mypid == procpid) || 243 if ((usepid && mypid == procpid) ||
244 (!usepid && ((ret = stat_exe(procpid, &statbuf) != -1) && statbuf.st_dev == mydev && statbuf.st_ino == myino) || 244 ( ((!usepid) && ((ret = stat_exe(procpid, &statbuf) != -1) && statbuf.st_dev == mydev && statbuf.st_ino == myino)) ||
245 (ret == -1 && errno == ENOENT))) { 245 (ret == -1 && errno == ENOENT))
246 ) {
246 if (verbose >= 3) 247 if (verbose >= 3)
247 printf("not considering - is myself or gone\n"); 248 printf("not considering - is myself or gone\n");
248 continue; 249 continue;