MCPcopy Create free account
hub / github.com/Tencent/UnLua / lpb_readbytes

Function lpb_readbytes

Plugins/UnLuaExtensions/LuaProtobuf/Source/src/pb.cpp:279–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279static void lpb_readbytes(lua_State *L, pb_Slice *s, pb_Slice *pv) {
280 uint64_t len = 0;
281 if (pb_readvarint64(s, &len) == 0 || len > PB_MAX_SIZET)
282 luaL_error(L, "invalid bytes length: %d (at offset %d)",
283 (int)len, pb_pos(*s)+1);
284 if (pb_readslice(s, (size_t)len, pv) == 0 && len != 0)
285 luaL_error(L, "unfinished bytes (len %d at offset %d)",
286 (int)len, pb_pos(*s)+1);
287}
288
289static int lpb_hexchar(char ch) {
290 switch (ch) {

Callers 4

lpb_readtypeFunction · 0.85
lpbD_rawfieldFunction · 0.85
lpbD_mapFunction · 0.85
lpbD_repeatedFunction · 0.85

Calls 4

pb_readvarint64Function · 0.85
luaL_errorFunction · 0.85
pb_posFunction · 0.85
pb_readsliceFunction · 0.85

Tested by

no test coverage detected