From a3e88aa0fb01db4bf986545f833e220bf8647036 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Tue, 12 Sep 2023 11:47:15 -0400 Subject: [PATCH] Keep magic number for last line --- main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 2563a55..0a49f75 100644 --- a/main.c +++ b/main.c @@ -43,8 +43,6 @@ #define ZX_CHAR_TOKEN(c) \ (ZX_CHAR_TOKEN_LOW(c) || ZX_CHAR_TOKEN_HIGH(c)) -#define ZX_BASIC_STATE_SIZE 116 - #define ZX_CHAR_TOKEN_INTEGRAL(c) \ (c == 0x0e) @@ -55,6 +53,9 @@ typedef struct _zx_basic_line { uint16_t num, len; } zx_basic_line; +#define ZX_BASIC_STATE_SIZE 116 +#define ZX_BASIC_LINE_LAST 0x7676 + static uint32_t zx_charset[ZX_DUMP_CHARSET_LEN] = { 0x0020, 0x2598, 0x259d, 0x2580, 0x2596, 0x258c, 0x259e, 0x259b, 0x2592, '.', '.', '"', 0x00a3, '$', ':', '?', @@ -281,7 +282,7 @@ static ssize_t zx_dump_basic(int fd) { len = le16toh(line.len); - if (be16toh(line.num) == len) { + if (be16toh(line.num) == len && len == ZX_BASIC_LINE_LAST) { break; }