From: notaz Date: Tue, 21 Nov 2023 22:37:49 +0000 (+0200) Subject: don't use a stack var out of scope X-Git-Tag: r24~42 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ca1e56e16f03f7afb8988474f3a55e164960665;p=pcsx_rearmed.git don't use a stack var out of scope newer compilers are stricter about this, as well as asan --- diff --git a/frontend/main.c b/frontend/main.c index cec1fbbf..019835dd 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -590,6 +590,7 @@ int main(int argc, char *argv[]) { char file[MAXPATHLEN] = ""; char path[MAXPATHLEN]; + char isofilename[MAXPATHLEN]; const char *cdfile = NULL; const char *loadst_f = NULL; int psxout = 0; @@ -608,8 +609,6 @@ int main(int argc, char *argv[]) SysPrintf("Using config file %s.\n", cfgfile_basename); } else if (!strcmp(argv[i], "-cdfile")) { - char isofilename[MAXPATHLEN]; - if (i+1 >= argc) break; strncpy(isofilename, argv[++i], MAXPATHLEN); if (isofilename[0] != '/') {