diff options
author | Roman Artemev <rartemev@microsoft.com> | 2017-04-06 15:54:03 -0700 |
---|---|---|
committer | Roman Artemev <rartemev@microsoft.com> | 2017-04-06 15:54:03 -0700 |
commit | a1718a86e0d706ae11baa2880effc4e84f55bcc8 (patch) | |
tree | 45fe7430aed38aa7133012df3f0f40e164b5abf1 /src/ilasm | |
parent | 9c74cbac6c86f2c484c7ebd4c81a6aee6bd7cc25 (diff) | |
download | coreclr-a1718a86e0d706ae11baa2880effc4e84f55bcc8.tar.gz coreclr-a1718a86e0d706ae11baa2880effc4e84f55bcc8.tar.bz2 coreclr-a1718a86e0d706ae11baa2880effc4e84f55bcc8.zip |
Correct fix for long ilasm params
Diffstat (limited to 'src/ilasm')
-rw-r--r-- | src/ilasm/main.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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; |