diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2019-01-14 16:29:18 -0200 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2019-01-14 16:30:39 -0200 |
| commit | ec348d4344da548a3b7b22f644953e5fa275c1df (patch) | |
| tree | 5be2a760f54d1326fc43f33ee5b81d4cfbce1d6a | |
| parent | e4587bc559f863428b3380648e3ab157eb31dee8 (diff) | |
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>
| -rw-r--r-- | lib/northbound.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/northbound.c b/lib/northbound.c index a7f9c8620e..70d11a4a42 100644 --- a/lib/northbound.c +++ b/lib/northbound.c @@ -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; |
