]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Lua tables are indexed from 1
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 1 Apr 2019 19:29:55 +0000 (21:29 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 1 Apr 2019 19:29:55 +0000 (21:29 +0200)
pdns/dnsdist-lua-bindings.cc

index 79e01d2e13792acb0162eab0757f63caea9d4115..c359d6a1505aadd171bfb1ed5aefb876beb20105 100644 (file)
@@ -662,7 +662,7 @@ void setupLuaBindings(bool client)
   g_lua.registerFunction<std::vector<std::pair<int, string>>(EDNSOptionView::*)()>("getValues", [] (const EDNSOptionView& option) {
     std::vector<std::pair<int, string> > values;
     for (const auto& value : option.values) {
-      values.push_back(std::make_pair(values.size(), std::string(value.content, value.size)));
+      values.push_back(std::make_pair(values.size()+1, std::string(value.content, value.size)));
     }
     return values;
   });