diff options
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) { |
