Skip to content

Commit

Permalink
- fix incorrect offset in error message.
Browse files Browse the repository at this point in the history
- fix packed option in `protoc`.
  • Loading branch information
starwing committed Oct 4, 2018
1 parent 53d9ac1 commit 1d7625c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pb.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ static void lpb_readbytes(lua_State *L, lpb_SliceEx *s, lpb_SliceEx *pv) {
if (pb_readslice(&s->base, (size_t)len, &pv->base) == 0 && len != 0)
luaL_error(L, "un-finished bytes (len %d at offset %d)",
(int)len, lpb_offset(s));
pv->head = pv->base.p;
pv->head = s->head;
}

static int lpb_hexchar(char ch) {
Expand Down
3 changes: 3 additions & 0 deletions protoc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ local function field(self, lex, ident)
if options then
info.default_value, options.default = tostring(options.default), nil
info.json_name, options.json_name = options.json_name, nil
if options.packed and options.packed == "false" then
options.packed = false
end
end
info.options = options
if info.number <= 0 then
Expand Down

0 comments on commit 1d7625c

Please sign in to comment.