From 5a5d52285f32811215c2ffce280c2ac55a5b8599 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Wed, 17 Jul 2019 12:09:34 +0200 Subject: Correct a return in 'CtlConfigExec' function Avoid a 'return -0' when an error has been caught during first section callback execution. Bug-AGL: SPEC-2568 Change-Id: Ic407f8be0afd0236b1880b6c33e5339470f68b33 Signed-off-by: Jonathan Aillet --- ctl-lib/ctl-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c index cd89bc0..2970955 100644 --- a/ctl-lib/ctl-config.c +++ b/ctl-lib/ctl-config.c @@ -163,7 +163,7 @@ int CtlConfigExec(afb_api_t apiHandle, CtlConfigT *ctlConfig) { error = ctlConfig->sections[idx].loadCB(apiHandle, &ctlConfig->sections[idx], NULL); if (error < 0) { AFB_API_ERROR(apiHandle, "Error %i caught during call to '%s' section callback", error, ctlConfig->sections[idx].key); - return -idx; + return -(idx + 1); } else if (error > 0) { AFB_API_WARNING(apiHandle, "Warning %i raised during call to '%s' section callback", error, ctlConfig->sections[idx].key); -- cgit 1.2.3-korg