Skip to content

Commit 3b7a7f4

Browse files
authored
[sanitizer] Add missing newlines to __sanitizer_set_report_path() error messages (#98626)
"Can't open file:" and "Can't create directory:" are lacking a newline.
1 parent 7232763 commit 3b7a7f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_file.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void ReportFile::ReopenIfNecessary() {
6969
WriteToFile(kStderrFd, ErrorMsgPrefix, internal_strlen(ErrorMsgPrefix));
7070
WriteToFile(kStderrFd, full_path, internal_strlen(full_path));
7171
char errmsg[100];
72-
internal_snprintf(errmsg, sizeof(errmsg), " (reason: %d)", err);
72+
internal_snprintf(errmsg, sizeof(errmsg), " (reason: %d)\n", err);
7373
WriteToFile(kStderrFd, errmsg, internal_strlen(errmsg));
7474
Die();
7575
}
@@ -88,6 +88,8 @@ static void RecursiveCreateParentDirs(char *path) {
8888
const char *ErrorMsgPrefix = "ERROR: Can't create directory: ";
8989
WriteToFile(kStderrFd, ErrorMsgPrefix, internal_strlen(ErrorMsgPrefix));
9090
WriteToFile(kStderrFd, path, internal_strlen(path));
91+
const char *ErrorMsgSuffix = "\n";
92+
WriteToFile(kStderrFd, ErrorMsgSuffix, internal_strlen(ErrorMsgSuffix));
9193
Die();
9294
}
9395
path[i] = save;

0 commit comments

Comments
 (0)