From c0a660f474384e0e3c7d4dd75c9b3e6b32daca9f Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Tue, 11 Jul 2017 13:50:53 -0500 Subject: Added upb_stringview, the string representation for upb_msg. --- upb/bindings/lua/msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'upb/bindings/lua/msg.c') diff --git a/upb/bindings/lua/msg.c b/upb/bindings/lua/msg.c index 41163bc..e468ace 100644 --- a/upb/bindings/lua/msg.c +++ b/upb/bindings/lua/msg.c @@ -434,7 +434,7 @@ static upb_msgval lupb_tomsgval(lua_State *L, upb_fieldtype_t type, int narg, case UPB_TYPE_BYTES: { size_t len; const char *ptr = lupb_checkstring(L, narg, &len); - return upb_msgval_str(ptr, len); + return upb_msgval_makestr(ptr, len); } case UPB_TYPE_MESSAGE: UPB_ASSERT(lmsgclass); @@ -1014,7 +1014,7 @@ static int lupb_msg_index(lua_State *L) { if (upb_msg_has(lmsg->msg, field_index, l)) { upb_msgval val = upb_msg_get(lmsg->msg, field_index, l); lua_pop(L, 1); - lua_pushlstring(L, val.str.ptr, val.str.len); + lua_pushlstring(L, val.str.data, val.str.size); lupb_uservalseti(L, 1, lupb_fieldindex(f), -1); } } -- cgit v1.2.3