From a1718a86e0d706ae11baa2880effc4e84f55bcc8 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Thu, 6 Apr 2017 15:54:03 -0700 Subject: Correct fix for long ilasm params --- src/ilasm/main.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/ilasm') diff --git a/src/ilasm/main.cpp b/src/ilasm/main.cpp index 912ccce859..29a24b0203 100644 --- a/src/ilasm/main.cpp +++ b/src/ilasm/main.cpp @@ -106,7 +106,6 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) { int i, NumFiles = 0, NumDeltaFiles = 0; bool IsDLL = false, IsOBJ = false; - char szOpt[1024]; Assembler *pAsm; MappedFileStream *pIn; AsmParse *pParser; @@ -224,14 +223,13 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) if((argv[i][0] == L'/') || (argv[i][0] == L'-')) #endif { - memset(szOpt,0,sizeof(szOpt)); - WszWideCharToMultiByte(uCodePage,0,&argv[i][1],-1,szOpt,sizeof(szOpt),NULL,NULL); - szOpt[3] = 0; - if (!_stricmp(szOpt,"NOA")) + char szOpt[3 + 1] = { 0 }; + WszWideCharToMultiByte(uCodePage, 0, &argv[i][1], 3, szOpt, sizeof(szOpt), NULL, NULL); + if (!_stricmp(szOpt, "NOA")) { pAsm->m_fAutoInheritFromObject = FALSE; } - else if (!_stricmp(szOpt,"QUI")) + else if (!_stricmp(szOpt, "QUI")) { pAsm->m_fReportProgress = FALSE; bReportProgress = FALSE; -- cgit v1.2.3