From 4359aa8d4b25205e21779b23a1216d2f8614f5ef Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Sun, 29 Sep 2024 23:00:00 +0100 Subject: [PATCH] commands/CmdWizard.c: %x => (intmax_t) %lx Wrong type of arguments to formatting function Looks like SPICE comment, change maintains hex without 0x prefix in portable way. Copilot Autofix rejected: TxPrintf("%p\n", tp); CodeQL: https://github.com/dlmiles/magic/security/code-scanning/65 --- commands/CmdWizard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/CmdWizard.c b/commands/CmdWizard.c index 06598a24..b66d8828 100644 --- a/commands/CmdWizard.c +++ b/commands/CmdWizard.c @@ -24,6 +24,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/ #endif /* not lint */ #include +#include #include #include #include @@ -976,7 +977,7 @@ cmdTsrFunc(tp) Tile *tp; { if (cmdTsearchDebug) - TxPrintf("%x\n", tp); + TxPrintf("%lx\n", (intmax_t) tp); numTilesFound++; return 0; }