From: Chris Bieneman Date: Wed, 28 Jan 2015 22:25:00 +0000 (+0000) Subject: Build fix for Visual Studio. NFC. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=75a1a5c24bf6f75574dd364e9d81d4b5674e0dcc;p=oota-llvm.git Build fix for Visual Studio. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227385 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index bdebe97d872..2ca9caa1d91 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -87,7 +87,7 @@ class CommandLineParser { public: // Globals for name and overview of program. Program name is not a string to // avoid static ctor/dtor issues. - char ProgramName[80] = ""; + std::string ProgramName; const char *ProgramOverview = nullptr; // This collects additional help to be printed. @@ -837,10 +837,7 @@ void CommandLineParser::ParseCommandLineOptions(int argc, argc = static_cast(newArgv.size()); // Copy the program name into ProgName, making sure not to overflow it. - StringRef ProgName = sys::path::filename(argv[0]); - size_t Len = std::min(ProgName.size(), size_t(79)); - memcpy(ProgramName, ProgName.data(), Len); - ProgramName[Len] = '\0'; + ProgramName = sys::path::filename(argv[0]); ProgramOverview = Overview; bool ErrorParsing = false;