lib: fix "may be used uninitialized" build warning

We are already handling all possible four cases from the "nb_event"
enumeration, so this problem can't happen in practice. Initialize the
"ref" variable to zero to silence the warning.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2019-01-14 16:29:18 -02:00
parent e4587bc559
commit ec348d4344

View File

@ -719,7 +719,6 @@ static int nb_configuration_callback(const enum nb_event event,
const struct lyd_node *dnode = change->cb.dnode;
union nb_resource *resource;
int ret = NB_ERR;
enum lib_log_refs ref;
if (debug_northbound) {
const char *value = "(none)";
@ -753,6 +752,8 @@ static int nb_configuration_callback(const enum nb_event event,
}
if (ret != NB_OK) {
enum lib_log_refs ref = 0;
switch (event) {
case NB_EV_VALIDATE:
ref = EC_LIB_NB_CB_CONFIG_VALIDATE;