Skip to content

Commit

Permalink
Increase the buffer size for certain logging methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-may committed Apr 14, 2023
1 parent ecca8e4 commit 763095d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 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 = 13
ClientMinorVersion = 14
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions include/EACopyShared.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace eacopy

enum { CopyContextBufferSize = 8*1024*1024 }; // This is the chunk size used when reading/writing/copying files
enum { MaxPath = 4096 }; // Max path for EACopy
enum { LogBufferSize = 10000 }; // Size of buffer used when printing log messages

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Types
Expand Down
10 changes: 5 additions & 5 deletions source/EACopyShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ void logErrorf(const wchar_t* fmt, ...)
{
va_list arg;
va_start(arg, fmt);
wchar_t buffer[4096];
wchar_t buffer[LogBufferSize];
stringCopy(buffer, eacopy_sizeof_array(buffer), L"!!ERROR - ");
auto len = wcslen(buffer);
int written = vswprintf_s(buffer + len, eacopy_sizeof_array(buffer) - len, fmt, arg);
Expand All @@ -489,7 +489,7 @@ void logInfof(const wchar_t* fmt, ...)
{
va_list arg;
va_start(arg, fmt);
wchar_t buffer[4096];
wchar_t buffer[LogBufferSize];
vswprintf_s(buffer, eacopy_sizeof_array(buffer), fmt, arg);
logInternal(buffer, false, false, false);
va_end(arg);
Expand All @@ -499,7 +499,7 @@ void logInfoLinef(const wchar_t* fmt, ...)
{
va_list arg;
va_start(arg, fmt);
wchar_t buffer[4096];
wchar_t buffer[LogBufferSize];
int count = vswprintf_s(buffer, eacopy_sizeof_array(buffer), fmt, arg);
if (count)
logInternal(buffer, false, true, false);
Expand All @@ -519,7 +519,7 @@ void logDebugf(const wchar_t* fmt, ...)

va_list arg;
va_start(arg, fmt);
wchar_t buffer[4096];
wchar_t buffer[LogBufferSize];
vswprintf_s(buffer, eacopy_sizeof_array(buffer), fmt, arg);
logInternal(buffer, false, false, false);
va_end(arg);
Expand All @@ -533,7 +533,7 @@ void logDebugLinef(const wchar_t* fmt, ...)

va_list arg;
va_start(arg, fmt);
wchar_t buffer[4096];
wchar_t buffer[LogBufferSize];
vswprintf_s(buffer, eacopy_sizeof_array(buffer), fmt, arg);
logInternal(buffer, false, true, false);
va_end(arg);
Expand Down

0 comments on commit 763095d

Please sign in to comment.