Skip to content

Commit

Permalink
Merge pull request #830 from swiftlang/android/6pick
Browse files Browse the repository at this point in the history
[release/6.0] Testing: add some force unwraps for Android
  • Loading branch information
compnerd authored Nov 20, 2024
2 parents 5e6c8a6 + eaa9dac commit 7efdd76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Testing/Support/FileHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ extension FileHandle {
try withUnsafeCFILEHandle { file in
try withUnsafeTemporaryAllocation(byteCount: 1024, alignment: 1) { buffer in
repeat {
let countRead = fread(buffer.baseAddress, 1, buffer.count, file)
let countRead = fread(buffer.baseAddress!, 1, buffer.count, file)
if 0 != ferror(file) {
throw CError(rawValue: swt_errno())
}
Expand Down Expand Up @@ -295,7 +295,7 @@ extension FileHandle {
}
}

let countWritten = fwrite(bytes.baseAddress, MemoryLayout<UInt8>.stride, bytes.count, file)
let countWritten = fwrite(bytes.baseAddress!, MemoryLayout<UInt8>.stride, bytes.count, file)
if countWritten < bytes.count {
throw CError(rawValue: swt_errno())
}
Expand Down

0 comments on commit 7efdd76

Please sign in to comment.