From fbe7398d0f0ab6c4c88088b5bb1f35fd0e2f68f3 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 6 Jun 2018 21:32:48 -0400 Subject: [PATCH] Ensures that the byte count is rounded up. --- dsk2woz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsk2woz.c b/dsk2woz.c index 54dee27..66d9827 100755 --- a/dsk2woz.c +++ b/dsk2woz.c @@ -431,8 +431,8 @@ static void serialise_track(uint8_t *dest, const uint8_t *src, uint8_t track_num } // Add the track suffix. - dest[6646] = (track_position >> 3) & 0xff; - dest[6647] = (track_position >> 11) & 0xff; // Byte count. + dest[6646] = ((track_position + 7) >> 3) & 0xff; + dest[6647] = ((track_position + 7) >> 11) & 0xff; // Byte count. dest[6648] = track_position & 0xff; dest[6649] = (track_position >> 8) & 0xff; // Bit count. dest[6650] = dest[6651] = 0x00; // Splice information.