Skip to content

Commit

Permalink
Correctly check if a warning message lacks a trailing new line
Browse files Browse the repository at this point in the history
Summary: Fixes LLVM bug 41489.

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D60653

llvm-svn: 358477
  • Loading branch information
Teemperor committed Apr 16, 2019
1 parent 6547d51 commit 376230c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lldb/source/Core/Module.cpp
Expand Up @@ -1120,7 +1120,7 @@ void Module::ReportError(const char *format, ...) {
const int format_len = strlen(format);
if (format_len > 0) {
const char last_char = format[format_len - 1];
if (last_char != '\n' || last_char != '\r')
if (last_char != '\n' && last_char != '\r')
strm.EOL();
}
Host::SystemLog(Host::eSystemLogError, "%s", strm.GetData());
Expand Down Expand Up @@ -1152,7 +1152,7 @@ void Module::ReportErrorIfModifyDetected(const char *format, ...) {
const int format_len = strlen(format);
if (format_len > 0) {
const char last_char = format[format_len - 1];
if (last_char != '\n' || last_char != '\r')
if (last_char != '\n' && last_char != '\r')
strm.EOL();
}
strm.PutCString("The debug session should be aborted as the original "
Expand All @@ -1178,7 +1178,7 @@ void Module::ReportWarning(const char *format, ...) {
const int format_len = strlen(format);
if (format_len > 0) {
const char last_char = format[format_len - 1];
if (last_char != '\n' || last_char != '\r')
if (last_char != '\n' && last_char != '\r')
strm.EOL();
}
Host::SystemLog(Host::eSystemLogWarning, "%s", strm.GetData());
Expand Down

0 comments on commit 376230c

Please sign in to comment.