Skip to content

Commit

Permalink
call common validation function
Browse files Browse the repository at this point in the history
Co-authored-by: MicroDev <[email protected]>
  • Loading branch information
jepler and microdev1 authored Mar 22, 2023
1 parent 349dedc commit 98c546b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions shared-module/struct/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ void shared_modules_struct_pack_into(mp_obj_t fmt_in, byte *p, byte *end_p, size
}
fmt++;
}
if (i != n_args) {
mp_raise_ValueError_varg(translate("%q length must be %d"), MP_QSTR_args, i);
}
(void)mp_arg_validate_length(n_args, i, MP_QSTR_args);
}

mp_obj_tuple_t *shared_modules_struct_unpack_from(mp_obj_t fmt_in, byte *p, byte *end_p, bool exact_size) {
Expand Down

0 comments on commit 98c546b

Please sign in to comment.