From fd1cc566253819100a416b5be37547c75fecf314 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Tue, 16 Dec 2014 15:23:29 -0800 Subject: Modified strtable to support length-delimited string keys. Allows for arbitrary binary data, e.g., to support strings from other languages as key values. --- upb/bindings/lua/table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'upb/bindings/lua/table.c') diff --git a/upb/bindings/lua/table.c b/upb/bindings/lua/table.c index febadf0..e15382b 100644 --- a/upb/bindings/lua/table.c +++ b/upb/bindings/lua/table.c @@ -68,7 +68,7 @@ static void lupbtable_pushent(lua_State *L, const upb_tabent *e, if (inttab) { lua_pushnumber(L, e->key.num); } else { - lua_pushstring(L, e->key.str); + lua_pushlstring(L, e->key.s.str, e->key.s.length); } lua_setfield(L, -2, "key"); lupbtable_pushval(L, e->val, ctype); -- cgit v1.2.3