Fixed bugs found for the bitmap mask, JSON reader and wifi wrappers in the library.

This commit is contained in:
2026-09-18 12:50:47 +02:00
parent 9ae10590cc
commit d33cf4c528
5 changed files with 97 additions and 26 deletions
+3 -3
View File
@@ -120,9 +120,9 @@ extension JSON {
// Borrowing keeps the `SDFile` open for the whole decode.
reader.userdata = file.pointer
reader.read = { userdata, buffer, size in
guard let userdata, let buffer else { return -1 }
let count = fileAPI.pointee.read.unsafelyUnwrapped(userdata, buffer, UInt32(size))
return count > 0 ? count : -1
// `file->read` returns 0 at end of data, as the decoder expects.
guard let userdata, let buffer else { return 0 }
return fileAPI.pointee.read.unsafelyUnwrapped(userdata, buffer, UInt32(size))
}
var outval = json_value()
let ok = withExtendedLifetime(context) {