mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-05-28 04:35:40 -04:00
check_snmp: Close potential for using uninitialized memory
This was reported by clang, and in order for it to understand attributes properly, I had to modify the macro that checks for non-gcc compilers. Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
This commit is contained in:
parent
d87395ec3d
commit
a20611d435
2 changed files with 5 additions and 4 deletions
|
|
@ -229,13 +229,14 @@ main (int argc, char **argv)
|
|||
|
||||
np_set_args(argc, argv);
|
||||
|
||||
time(¤t_time);
|
||||
|
||||
if (process_arguments (argc, argv) == ERROR)
|
||||
usage4 (_("Could not parse arguments"));
|
||||
|
||||
if(calculate_rate) {
|
||||
if (!strcmp(label, "SNMP"))
|
||||
label = strdup("SNMP RATE");
|
||||
time(¤t_time);
|
||||
i=0;
|
||||
previous_state = np_state_read();
|
||||
if(previous_state!=NULL) {
|
||||
|
|
|
|||
|
|
@ -208,9 +208,9 @@ enum {
|
|||
# define bindtextdomain(Domainname, Dirname) /* empty */
|
||||
#endif
|
||||
|
||||
/* For non-GNU compilers to ignore __attribute__ */
|
||||
#ifndef __GNUC__
|
||||
# define __attribute__(x) /* do nothing */
|
||||
/* For non-GNU/non-clang compilers to ignore __attribute__ */
|
||||
#if !defined(__GNUC__) && !defined(__CLANG__)
|
||||
# define __attribute__(noreturn) /* do nothing */
|
||||
#endif
|
||||
|
||||
#endif /* _COMMON_H_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue