From 26b545f36867508da2f2f318a93d78e673436598 Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Sun, 13 Oct 2024 11:09:40 +0900 Subject: [PATCH] apinames: Fix out-of-scope reference of a static array. * apinames.c (names_dump): For WATCOM_LBC format, the DLL name with no suffix is constructed on a static array temp[], but the scope is closed before use it. The declaration of temp[] is moved to the wider scope for the dumping part to refer it. --- src/tools/apinames.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/apinames.c b/src/tools/apinames.c index 38407b2d7..343428bac 100644 --- a/src/tools/apinames.c +++ b/src/tools/apinames.c @@ -181,6 +181,7 @@ names_dump( FILE* out, case OUTPUT_WATCOM_LBC: { + char temp[512]; const char* dot; @@ -195,7 +196,6 @@ names_dump( FILE* out, dot = strchr( dll_name, '.' ); if ( dot ) { - char temp[512]; int len = dot - dll_name;