aboutsummaryrefslogtreecommitdiffstats
path: root/unpack.c
diff options
context:
space:
mode:
Diffstat (limited to 'unpack.c')
-rw-r--r--unpack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unpack.c b/unpack.c
index 7786ca6..45ba8fd 100644
--- a/unpack.c
+++ b/unpack.c
@@ -79,7 +79,7 @@ static void read_fields(struct dest dest, const void *src_, enum pack_endian end
vals = val.unsigned_;
} else {
vals = minval(s);
- vals += val.unsigned_ ^ (UINTMAX_C(1) << (s * 8 - 1));
+ vals += (intmax_t)(val.unsigned_ ^ (UINTMAX_C(1) << (s * 8 - 1)));
}
val.signed_ = vals;
tr_debug("val.s: %" PRIdMAX, val.signed_);