From b6866425f3be0c97d7d191b4326c2fbc865b7935 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Wed, 28 Jan 2015 22:25:00 +0000 Subject: [PATCH] Build fix for Visual Studio. NFC. llvm-svn: 227385 --- llvm/lib/Support/CommandLine.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index bdebe97..2ca9caa 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/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; -- 2.7.4