fix: Satisfy SwiftLint empty_count rule in write() guard

This commit is contained in:
phranck
2026-01-30 17:10:50 +01:00
parent cb491f231d
commit 17f5be065e
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -1,8 +1,9 @@
[![CI](https://github.com/phranck/TUIKit/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/phranck/TUIKit/actions/workflows/ci.yml)
![Tests](https://img.shields.io/badge/Tests-181_passing-brightgreen)
![Swift 6.0](https://img.shields.io/badge/Swift-6.0-F05138?logo=swift&logoColor=white)
![macOS](https://img.shields.io/badge/Platform-macOS-000000?logo=apple&logoColor=white)
![Linux](https://img.shields.io/badge/Platform-Linux-FCC624?logo=linux&logoColor=black)
![License](https://img.shields.io/badge/License-MIT-blue)
![Tests](https://img.shields.io/badge/Tests-181_passing-brightgreen)
![License](https://img.shields.io/badge/License-CC--BY--NC--SA%204.0-lightgrey?style=flat)
![Spotnik - Terminal based Sptoify Player](.github/assets/spotnik_1.png)
@@ -170,4 +171,4 @@ Tests/
## License
MIT
This repository has been published under the [CC-BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) license.
+1 -1
View File
@@ -157,7 +157,7 @@ public final class Terminal: @unchecked Sendable {
string.utf8CString.withUnsafeBufferPointer { buffer in
// buffer includes null terminator exclude it
let count = buffer.count - 1
guard count > 0 else { return }
guard count >= 1 else { return }
buffer.baseAddress!.withMemoryRebound(to: UInt8.self, capacity: count) { pointer in
var written = 0
while written < count {