From 24c3e9b283da26093ca653fc6b441042fedec135 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 2 Sep 2019 12:57:51 +1000 Subject: py/modstruct: Fix struct.pack_into with unaligned offset of native type. Following the same fix for unpack. --- extmod/moductypes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extmod') diff --git a/extmod/moductypes.c b/extmod/moductypes.c index d4c7611df..cf83f43e3 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -305,7 +305,7 @@ static inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) { static inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) { char struct_type = big_endian ? '>' : '<'; static const char type2char[16] = "BbHhIiQq------fd"; - mp_binary_set_val(struct_type, type2char[val_type], val, &p); + mp_binary_set_val(struct_type, type2char[val_type], val, p, &p); } static inline mp_uint_t get_aligned_basic(uint val_type, void *p) { -- cgit v1.2.3