diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-18 22:59:24 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-18 22:59:24 +0100 |
commit | b11b85adaac9ac2e460647e59f951f5086cd2d4e (patch) | |
tree | c0c2e5b3159cc7e6455e9614ce93c5e432029428 /py/modstruct.c | |
parent | a8f5d15fc6f2ee988e028ce8a5fc9f50c17309f4 (diff) |
py: Allow to pass buffer protocol flags to get_buffer helper funcs.
Diffstat (limited to 'py/modstruct.c')
-rw-r--r-- | py/modstruct.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/modstruct.c b/py/modstruct.c index 945f4fe46..cd2516b24 100644 --- a/py/modstruct.c +++ b/py/modstruct.c @@ -56,7 +56,7 @@ STATIC mp_obj_t struct_unpack(mp_obj_t fmt_in, mp_obj_t data_in) { uint size = calcsize_items(fmt); mp_obj_tuple_t *res = mp_obj_new_tuple(size, NULL); mp_buffer_info_t bufinfo; - mp_get_buffer_raise(data_in, &bufinfo); + mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_READ); byte *p = bufinfo.buf; for (uint i = 0; i < size; i++) { |