From fe1c3f6bec27806e15e013b04a8643885db9aa82 Mon Sep 17 00:00:00 2001 From: Finagolfin Date: Sat, 25 Nov 2023 10:56:11 +0530 Subject: [PATCH] Android: force unwrap address passed to fwrite() for NDK 26 Motivation: Get this repo building with Android NDK 26, which added nullability annotations Modifications: - A single force unwrap of a buffer's baseAddress Result: This repo builds and passes its tests with the latest Android LTS NDK 26. --- Sources/NIOSSHClient/ExecHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/NIOSSHClient/ExecHandler.swift b/Sources/NIOSSHClient/ExecHandler.swift index 8dd244e7..bd93c2c0 100644 --- a/Sources/NIOSSHClient/ExecHandler.swift +++ b/Sources/NIOSSHClient/ExecHandler.swift @@ -100,7 +100,7 @@ final class ExampleExecHandler: ChannelDuplexHandler { case .stdErr: // We just write to stderr directly, pipe channel can't help us here. bytes.withUnsafeReadableBytes { str in - let rc = fwrite(str.baseAddress, 1, str.count, stderr) + let rc = fwrite(str.baseAddress!, 1, str.count, stderr) precondition(rc == str.count) }