From ee096d27df58e4a3658364f01dd96c4141d2001d Mon Sep 17 00:00:00 2001 From: Gros chien Date: Tue, 26 Aug 2025 23:45:39 +0200 Subject: [PATCH] Fix segfault when using -x without -l --- src/ca65/macro.c | 2 +- src/ca65/toklist.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ca65/macro.c b/src/ca65/macro.c index 260bbd866..6ea136c20 100644 --- a/src/ca65/macro.c +++ b/src/ca65/macro.c @@ -728,7 +728,7 @@ ExpandParam: /* Use next macro token */ TokSet (Mac->Exp); - if (ExpandMacros) { + if (ExpandMacros && SB_GetLen (&ListingName) > 0) { if (new_expand_line) { /* Suppress unneeded lines if short expansion ** the ExpandStart is used to ensure that diff --git a/src/ca65/toklist.c b/src/ca65/toklist.c index 7fd8cfcd3..5c8cadfcf 100644 --- a/src/ca65/toklist.c +++ b/src/ca65/toklist.c @@ -252,7 +252,7 @@ static int ReplayTokList (void* List) /* see description in macro.c */ static int new_expand_line = 1; - if (ExpandMacros) { + if (ExpandMacros && SB_GetLen (&ListingName) > 0) { if (new_expand_line) { if (LineLast->FragList == 0 && ExpandMacros==1) { LineCur->Output--;