From: Donatas Abraitis Date: Wed, 28 Aug 2024 12:31:47 +0000 (+0300) Subject: lib: Start from 1, not 0 when creating Lua tables for nexthops X-Git-Tag: base_10.2~153^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b1012b693fcfed29a05d99e8bea623902223dc7b;p=mirror%2Ffrr.git lib: Start from 1, not 0 when creating Lua tables for nexthops Lua technically enumerates arrays from 1, not 0. Signed-off-by: Donatas Abraitis --- diff --git a/lib/frrlua.c b/lib/frrlua.c index 2cab1a5460..6ad0b5796a 100644 --- a/lib/frrlua.c +++ b/lib/frrlua.c @@ -323,7 +323,7 @@ void lua_pushnexthop_group(lua_State *L, const struct nexthop_group *ng) { lua_newtable(L); struct nexthop *nexthop; - int i = 0; + int i = 1; for (ALL_NEXTHOPS_PTR(ng, nexthop)) { lua_pushnexthop(L, nexthop);