summaryrefslogtreecommitdiff
path: root/py/objint_mpz.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/objint_mpz.c')
-rw-r--r--py/objint_mpz.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/objint_mpz.c b/py/objint_mpz.c
index 600316a42..4a1a685bb 100644
--- a/py/objint_mpz.c
+++ b/py/objint_mpz.c
@@ -112,10 +112,10 @@ mp_obj_t mp_obj_int_from_bytes_impl(bool big_endian, size_t len, const byte *buf
return MP_OBJ_FROM_PTR(o);
}
-void mp_obj_int_to_bytes_impl(mp_obj_t self_in, bool big_endian, size_t len, byte *buf) {
+bool mp_obj_int_to_bytes_impl(mp_obj_t self_in, bool big_endian, size_t len, byte *buf) {
assert(mp_obj_is_exact_type(self_in, &mp_type_int));
mp_obj_int_t *self = MP_OBJ_TO_PTR(self_in);
- mpz_as_bytes(&self->mpz, big_endian, len, buf);
+ return mpz_as_bytes(&self->mpz, big_endian, self->mpz.neg, len, buf);
}
int mp_obj_int_sign(mp_obj_t self_in) {