Fixed bugs found for the bitmap mask, JSON reader and wifi wrappers in the library.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user