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 <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2024-08-28 15:31:47 +03:00
parent 3d2c589766
commit b1012b693f

View file

@ -323,7 +323,7 @@ void lua_pushnexthop_group(lua_State *L, const struct nexthop_group *ng)
{ {
lua_newtable(L); lua_newtable(L);
struct nexthop *nexthop; struct nexthop *nexthop;
int i = 0; int i = 1;
for (ALL_NEXTHOPS_PTR(ng, nexthop)) { for (ALL_NEXTHOPS_PTR(ng, nexthop)) {
lua_pushnexthop(L, nexthop); lua_pushnexthop(L, nexthop);