(rarchdb) Updates

This commit is contained in:
twinaphex 2015-01-14 18:51:09 +01:00
parent 2876a352e3
commit 06b13228d1
2 changed files with 3 additions and 3 deletions

View File

@ -73,8 +73,8 @@ end
local function unhex(s)
if not s then return nil end
return (s:gsub('.', function (c)
return string.format('%02X', string.byte(c))
return (s:gsub('..', function (c)
return string.char(tonumber(c, 16))
end))
end

View File

@ -94,7 +94,7 @@ static int value_provider(void *ctx, struct rmsgpack_dom_value *out) {
tmp_value->bool_ = lua_toboolean(L, value_idx);
break;
case LUA_TSTRING:
tmp_buff = strdup(lua_tostring(L, key_idx));
tmp_buff = strdup(lua_tostring(L, value_idx));
tmp_value->type = RDT_STRING;
tmp_value->string.len = strlen(tmp_buff);
tmp_value->string.buff = tmp_buff;