| 277 | } |
| 278 | |
| 279 | static 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 | |
| 289 | static int lpb_hexchar(char ch) { |
| 290 | switch (ch) { |
no test coverage detected