Skip to content

Commit

Permalink
[sanitizer] Add missing newlines to __sanitizer_set_report_path() err…
Browse files Browse the repository at this point in the history
…or messages (llvm#98626)

"Can't open file:" and "Can't create directory:" are lacking a newline.
  • Loading branch information
iii-i authored and aaryanshukla committed Jul 14, 2024
1 parent 4fa6b64 commit 676bf2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler-rt/lib/sanitizer_common/sanitizer_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void ReportFile::ReopenIfNecessary() {
WriteToFile(kStderrFd, ErrorMsgPrefix, internal_strlen(ErrorMsgPrefix));
WriteToFile(kStderrFd, full_path, internal_strlen(full_path));
char errmsg[100];
internal_snprintf(errmsg, sizeof(errmsg), " (reason: %d)", err);
internal_snprintf(errmsg, sizeof(errmsg), " (reason: %d)\n", err);
WriteToFile(kStderrFd, errmsg, internal_strlen(errmsg));
Die();
}
Expand All @@ -88,6 +88,8 @@ static void RecursiveCreateParentDirs(char *path) {
const char *ErrorMsgPrefix = "ERROR: Can't create directory: ";
WriteToFile(kStderrFd, ErrorMsgPrefix, internal_strlen(ErrorMsgPrefix));
WriteToFile(kStderrFd, path, internal_strlen(path));
const char *ErrorMsgSuffix = "\n";
WriteToFile(kStderrFd, ErrorMsgSuffix, internal_strlen(ErrorMsgSuffix));
Die();
}
path[i] = save;
Expand Down

0 comments on commit 676bf2f

Please sign in to comment.