mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-pack/pack.c (read_tmpl): direct return from skipping directives
We used to read counts after spaces, for example `pack("j 4")` read `4`
as counts after a space.
This commit is contained in:
@@ -1440,9 +1440,8 @@ read_tmpl(mrb_state *mrb, struct tmpl *tmpl, enum pack_type *typep, int *sizep,
|
||||
mrb_value s = mrb_str_new(mrb, &c, 1);
|
||||
mrb_raisef(mrb, E_ARGUMENT_ERROR, "unknown unpack directive %!v", s);
|
||||
}
|
||||
dir = PACK_DIR_SKIP;
|
||||
type = PACK_TYPE_NONE;
|
||||
break;
|
||||
*typep = PACK_TYPE_NONE;
|
||||
return PACK_DIR_SKIP;
|
||||
}
|
||||
|
||||
/* read suffix [0-9*_!<>] */
|
||||
|
||||
Reference in New Issue
Block a user