From 0bbf5695697ae123ae390609e5d8176c937f6d30 Mon Sep 17 00:00:00 2001 From: Marc Culler Date: Thu, 11 Feb 2021 19:39:44 -0600 Subject: [PATCH] One more arithmetic bug. --- append_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/append_data.c b/append_data.c index 2db9295..fa92c7b 100644 --- a/append_data.c +++ b/append_data.c @@ -102,9 +102,9 @@ void append_data( fathead.nfat_arch = 2; archs = (struct fat_arch *) calloc(fathead.nfat_arch, sizeof(struct fat_arch)); fathead_size = sizeof(fathead) + fathead.nfat_arch * sizeof(struct fat_arch); - fathead_padding = ((fathead_size + 0x3ffe) & 0x3fff) - fathead_size; + fathead_padding = ((fathead_size + 0x3fff) & ~0x3fff) - fathead_size; if (fathead_padding < 0) { - fathead_padding += 16384; + fathead_padding += 0x4000; } struct fat_arch arch = { .cputype = cputype,