From 260280ece02f4e11dee6ac008a24f8c05b69ca2a Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 18 Jan 2023 11:38:08 +0000 Subject: [PATCH] ngsi: fix access to signal list in dead-code Signed-off-by: Steffen Vogel --- lib/nodes/ngsi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nodes/ngsi.cpp b/lib/nodes/ngsi.cpp index 250c54ebe..d3813afad 100644 --- a/lib/nodes/ngsi.cpp +++ b/lib/nodes/ngsi.cpp @@ -184,9 +184,9 @@ public: json_t *json_value = json_array(); for (unsigned k = 0; k < cnt; k++) { - const auto *sig = (Signal *) list_at_safe(smp->signals, index); const auto *smp = &smps[k]; const auto *data = &smp->data[index]; + auto sig = smp->signals->getByIndex(index); json_array_append_new(json_value, json_pack("[ f, o, i ]", time_to_double(smp->ts.origin), @@ -349,7 +349,7 @@ int ngsi_parse_entity(NodeCompat *n, json_t *json_entity, struct Sample * const smp->ts.origin = tss; auto *sd = &smp->data[attr->index]; - auto *sig = (Signal *) list_at_safe(n->getInputSignals(false), attr->index); + auto sig = n->getInputSignals(false)->getByIndex(attr->index); if (!sig) return -11;