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.
This commit is contained in:
suzuki toshiya 2024-10-13 11:09:40 +09:00
parent 7c09421d83
commit 26b545f368

View File

@ -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;