mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
Replace strcpy with memcpy when we have the length around anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94746 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -507,8 +507,9 @@ void cl::ParseCommandLineOptions(int argc, char **argv,
|
||||
|
||||
// Copy the program name into ProgName, making sure not to overflow it.
|
||||
std::string ProgName = sys::Path(argv[0]).getLast();
|
||||
if (ProgName.size() > 79) ProgName.resize(79);
|
||||
strcpy(ProgramName, ProgName.c_str());
|
||||
size_t Len = std::min(ProgName.size(), size_t(79));
|
||||
memcpy(ProgramName, ProgName.data(), Len);
|
||||
ProgramName[Len] = '\0';
|
||||
|
||||
ProgramOverview = Overview;
|
||||
bool ErrorParsing = false;
|
||||
|
Reference in New Issue
Block a user