From 8778d1c56aee1e772523ea29fc4e521c639f769a Mon Sep 17 00:00:00 2001 From: Andrew Horton Date: Sun, 29 Mar 2020 10:39:40 +0100 Subject: [PATCH] Fix Boolean datatype So the Lua FFI seems to already take care of converting C `bool` to a Lua `boolean`. Comparing it with 1 means that Boolean values always end up `false`. Just remove the comparison and this fixes it. --- lib/resty/maxminddb.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/resty/maxminddb.lua b/lib/resty/maxminddb.lua index c88716b..06458f9 100644 --- a/lib/resty/maxminddb.lua +++ b/lib/resty/maxminddb.lua @@ -287,7 +287,7 @@ local function _dump_entry_data_list(entry_data_list,status) elseif data_type == MMDB_DATA_TYPE_UINT32 then val = entry_data_item.uint32 elseif data_type == MMDB_DATA_TYPE_BOOLEAN then - val = entry_data_item.boolean == 1 + val = entry_data_item.boolean elseif data_type == MMDB_DATA_TYPE_UINT64 then val = entry_data_item.uint64 elseif data_type == MMDB_DATA_TYPE_INT32 then