#4792 Calculated log message size rather than using fixed size

This commit is contained in:
Jerry (Xinyu Hou)
2016-07-14 07:55:13 -07:00
parent 18c2c90144
commit 83c0dea2e4
3 changed files with 19 additions and 14 deletions

View File

@@ -230,11 +230,7 @@ ProtocolUtil::vreadf(synergy::IStream* stream, const char* fmt, va_list args)
throw;
}
// don't cause buffer overrun, using +100 chars in case
// someone modifies this log message in future.
if (len + 100 < kLogMessageLength) {
LOG((CLOG_DEBUG2 "readf: read %d byte string: %.*s", len, len, sBuffer));
}
LOG((CLOG_DEBUG2 "readf: read %d byte string: %.*s", len, len, sBuffer));
// save the data
String* dst = va_arg(args, String*);