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: r24l~53 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e10accd2110230083c6f3ca24b5a1a371098f5e;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] != '/') {