mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-02-20 00:10:09 -05:00
Fixes for compiler warning -Wparentheses
This commit is contained in:
parent
15b4e89a42
commit
6972242126
4 changed files with 8 additions and 7 deletions
|
|
@ -92,14 +92,14 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){
|
|||
/* append the list to extra_args */
|
||||
if(extra_args==NULL){
|
||||
extra_args=ea1;
|
||||
while(ea1=ea1->next) ea_num++;
|
||||
while((ea1 = ea1->next)) ea_num++;
|
||||
}else{
|
||||
ea_tmp=extra_args;
|
||||
while(ea_tmp->next) {
|
||||
ea_tmp=ea_tmp->next;
|
||||
}
|
||||
ea_tmp->next=ea1;
|
||||
while(ea1=ea1->next) ea_num++;
|
||||
while((ea1 = ea1->next)) ea_num++;
|
||||
}
|
||||
ea1=ea_tmp=NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ char *np_extract_value(const char *varlist, const char *name, char sep) {
|
|||
/* strip leading spaces */
|
||||
for (; isspace(varlist[0]); varlist++);
|
||||
|
||||
if (tmp = index(varlist, sep)) {
|
||||
if ((tmp = index(varlist, sep))) {
|
||||
/* Value is delimited by a comma */
|
||||
if (tmp-varlist == 0) continue;
|
||||
value = (char *)calloc(1, tmp-varlist+1);
|
||||
|
|
@ -347,7 +347,7 @@ char *np_extract_value(const char *varlist, const char *name, char sep) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (tmp = index(varlist, sep)) {
|
||||
if ((tmp = index(varlist, sep))) {
|
||||
/* More keys, keep going... */
|
||||
varlist = tmp + 1;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1094,7 +1094,7 @@ check_http (void)
|
|||
microsec_firstbyte = deltime (tv_temp);
|
||||
elapsed_time_firstbyte = (double)microsec_firstbyte / 1.0e6;
|
||||
}
|
||||
while (pos = memchr(buffer, '\0', i)) {
|
||||
while ((pos = memchr(buffer, '\0', i))) {
|
||||
/* replace nul character with a blank */
|
||||
*pos = ' ';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,8 +241,9 @@ main (int argc, char **argv)
|
|||
|
||||
/* Ignore self */
|
||||
if ((usepid && mypid == procpid) ||
|
||||
(!usepid && ((ret = stat_exe(procpid, &statbuf) != -1) && statbuf.st_dev == mydev && statbuf.st_ino == myino) ||
|
||||
(ret == -1 && errno == ENOENT))) {
|
||||
( ((!usepid) && ((ret = stat_exe(procpid, &statbuf) != -1) && statbuf.st_dev == mydev && statbuf.st_ino == myino)) ||
|
||||
(ret == -1 && errno == ENOENT))
|
||||
) {
|
||||
if (verbose >= 3)
|
||||
printf("not considering - is myself or gone\n");
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue