summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-04-02 14:41:22 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2019-04-02 14:47:42 +0200
commit340c0f1e742558e2f295b1a8313c5696bc50e711 (patch)
tree5e41ac32905542ca8d9aba6f97777d72c3cca3a4
parent66bd15bab1f7e7c24be22aabde272755a0e05973 (diff)
Use the action API rather than the source one
Action's API member is the API calling the LUA function. It is better to use it instead of the source one which is user set up and may be non valid. Change-Id: Ia4638eb378ef7275bac016afaabef19a5eac2b9a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--ctl-lib/ctl-lua.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c
index e290ec1..04b4ce9 100644
--- a/ctl-lib/ctl-lua.c
+++ b/ctl-lib/ctl-lua.c
@@ -790,7 +790,7 @@ int LuaCallFunc(CtlSourceT *source, CtlActionT *action, json_object *queryJ) {
// effectively exec LUA script code
err = lua_pcall(luaState, count, 1, 0);
if (err) {
- AFB_API_ERROR(source->api, "LuaCallFunc: Fail calling %s error=%s", func, lua_tostring(luaState, -1));
+ AFB_API_ERROR(action->api, "LuaCallFunc: Fail calling %s error=%s", func, lua_tostring(luaState, -1));
return -1;
}