Skip to content

Commit

Permalink
Make EACopy more robust against crashes when logging long command lin…
Browse files Browse the repository at this point in the history
…e args.
  • Loading branch information
ben-may committed Jun 5, 2023
1 parent 77cdc0b commit 0708779
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/EACopyClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace eacopy

enum : uint {
ClientMajorVersion = 1,
ClientMinorVersion = 15
ClientMinorVersion = 16
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
11 changes: 10 additions & 1 deletion source/EACopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,16 @@ int main(int argc, char* argv_[])
logInfoLinef();
logInfoLinef(L" Source : %ls", settings.sourceDirectory.c_str());
logInfoLinef(L" Dest : %ls", settings.destDirectory.c_str());
logInfoLinef(L" Options :%ls", options.c_str()); // First space added in generated string
if (options.length() > (LogBufferSize - 20))
{
WString optionsSubStr = options.substr(0, (LogBufferSize - 20));
optionsSubStr.append(L" ... ");
logInfoLinef(L" Options :%ls", optionsSubStr.c_str());
}
else
{
logInfoLinef(L" Options :%ls", options.c_str()); // First space added in generated string
}
logInfoLinef();
logInfoLinef(L"-------------------------------------------------------------------------------");
logInfoLinef();
Expand Down

0 comments on commit 0708779

Please sign in to comment.