From d4539f866288725143aa54a238262fd1784d7929 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Wed, 18 Oct 2023 20:22:06 +0200 Subject: check_snmp: Use C99 booleans diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 56a586a..405ede3 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -135,7 +135,7 @@ int numoids = 0; int numauthpriv = 0; int numcontext = 0; int verbose = 0; -int usesnmpgetnext = FALSE; +bool usesnmpgetnext = false; char *warning_thresholds = NULL; char *critical_thresholds = NULL; thresholds **thlds; @@ -148,7 +148,7 @@ size_t eval_size = OID_COUNT_STEP; char *delimiter; char *output_delim; char *miblist = NULL; -int needmibs = FALSE; +bool needmibs = false; int calculate_rate = 0; double offset = 0.0; int rate_multiplier = 1; @@ -302,7 +302,7 @@ main (int argc, char **argv) } /* Create the command array to execute */ - if(usesnmpgetnext == TRUE) { + if(usesnmpgetnext) { snmpcmd = strdup (PATH_TO_SNMPGETNEXT); }else{ snmpcmd = strdup (PATH_TO_SNMPGET); @@ -777,7 +777,7 @@ process_arguments (int argc, char **argv) miblist = optarg; break; case 'n': /* usesnmpgetnext */ - usesnmpgetnext = TRUE; + usesnmpgetnext = true; break; case 'P': /* SNMP protocol version */ proto = optarg; @@ -831,7 +831,7 @@ process_arguments (int argc, char **argv) * so we have a mib variable, rather than just an SNMP OID, * so we have to actually read the mib files */ - needmibs = TRUE; + needmibs = true; } for (ptr = strtok(optarg, ", "); ptr != NULL; ptr = strtok(NULL, ", "), j++) { while (j >= oids_size) { @@ -1034,7 +1034,7 @@ validate_arguments () { /* check whether to load locally installed MIBS (CPU/disk intensive) */ if (miblist == NULL) { - if ( needmibs == TRUE ) { + if (needmibs) { miblist = strdup (DEFAULT_MIBLIST); }else{ miblist = ""; /* don't read any mib files for numeric oids */ -- cgit v0.10-9-g596f