]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Start from 1, not 0 when creating Lua tables for nexthops
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 28 Aug 2024 12:31:47 +0000 (15:31 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 28 Aug 2024 12:31:47 +0000 (15:31 +0300)
Lua technically enumerates arrays from 1, not 0.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
lib/frrlua.c

index 2cab1a5460f2f59d7d6ea32508899edebd1c5679..6ad0b5796a6d5af4a2386ae5399f80297a9ed166 100644 (file)
@@ -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);