diff options
| author | Andreas Baumann <mail@andreasbaumann.cc> | 2026-01-23 10:10:30 +0100 |
|---|---|---|
| committer | Andreas Baumann <mail@andreasbaumann.cc> | 2026-01-23 10:10:30 +0100 |
| commit | d28be4a00c5e2f3433b3d030aeac5ee656dc565d (patch) | |
| tree | 0aac73a89b209b4210fd783c4e0b1becf56a69f3 /plugins/check_snmp.c | |
| parent | 38f601be58071da7a30caa442b5e997632f2dd6c (diff) | |
| download | monitoring-plugins-d28be4a00c5e2f3433b3d030aeac5ee656dc565d.tar.gz | |
check_snmp_helpers.c: various possible fixes around const char */char * casts
Diffstat (limited to 'plugins/check_snmp.c')
| -rw-r--r-- | plugins/check_snmp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 0f62ce8b..2b3099c9 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
| @@ -256,7 +256,10 @@ int main(int argc, char **argv) { | |||
| 256 | 256 | ||
| 257 | timeout_interval = DEFAULT_SOCKET_TIMEOUT; | 257 | timeout_interval = DEFAULT_SOCKET_TIMEOUT; |
| 258 | 258 | ||
| 259 | np_init((char *)progname, argc, argv); | 259 | char progname_copy[256]; |
| 260 | strncpy(progname_copy, progname, sizeof(progname_copy)-1); | ||
| 261 | progname_copy[255] = '\0'; | ||
| 262 | np_init(progname_copy, argc, argv); | ||
| 260 | 263 | ||
| 261 | state_key stateKey = np_enable_state(NULL, 1, progname, argc, argv); | 264 | state_key stateKey = np_enable_state(NULL, 1, progname, argc, argv); |
| 262 | 265 | ||
| @@ -508,8 +511,8 @@ static process_arguments_wrapper process_arguments(int argc, char **argv) { | |||
| 508 | unsigned char *privpasswd = NULL; | 511 | unsigned char *privpasswd = NULL; |
| 509 | int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE; | 512 | int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE; |
| 510 | char *port = NULL; | 513 | char *port = NULL; |
| 511 | char *miblist = NULL; | 514 | const char *miblist = NULL; |
| 512 | char *connection_prefix = NULL; | 515 | const char *connection_prefix = NULL; |
| 513 | bool snmp_version_set_explicitely = false; | 516 | bool snmp_version_set_explicitely = false; |
| 514 | // TODO error checking | 517 | // TODO error checking |
| 515 | while (true) { | 518 | while (true) { |
