Skip to content

Commit

Permalink
ControllerDebug: Don't include null terminator in kLogMessagePrefixLe…
Browse files Browse the repository at this point in the history
…ngth
  • Loading branch information
Holzhaus committed Nov 28, 2020
1 parent a02b829 commit 2371014
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controllers/controllerdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ControllerDebug {
// Any debug statement starting with this prefix bypasses the --logLevel
// command line flags.
static constexpr const char kLogMessagePrefix[] = "CDBG";
static constexpr int kLogMessagePrefixLength = sizeof(kLogMessagePrefix);
static constexpr int kLogMessagePrefixLength = sizeof(kLogMessagePrefix) - 1;

static bool enabled();

Expand Down
2 changes: 1 addition & 1 deletion src/util/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void MessageHandler(QtMsgType type,

QByteArray input8Bit;
if (isControllerDebug) {
input8Bit = input.mid(ControllerDebug::kLogMessagePrefixLength).toLocal8Bit();
input8Bit = input.mid(ControllerDebug::kLogMessagePrefixLength + 1).toLocal8Bit();
} else {
input8Bit = input.toLocal8Bit();
}
Expand Down

0 comments on commit 2371014

Please sign in to comment.