Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Sources/XCLogParser/loglocation/LogLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@
do {
let data = try Data(contentsOf: url)
let unzipped = try data.gunzipped()
guard let contents = String(data: unzipped, encoding: .ascii) else {
let string: String? = unzipped.withUnsafeBytes { pointer in
guard let charPointer = pointer
.assumingMemoryBound(to: CChar.self)
.baseAddress

Check failure on line 32 in Sources/XCLogParser/loglocation/LogLoader.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
else {
return nil
}

return String(cString: charPointer, encoding: .ascii)
}
guard let contents = string else {
throw LogError.readingFile(url.path)
}
return contents
Expand Down
Loading