Skip to content

Commit

Permalink
#16 Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
clwi committed Nov 21, 2022
1 parent 97560cc commit 01d0012
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions goodies/swift/CWPackable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ extension Data: CWPackable {
}

init (_ unpacker: CWUnpacker) throws {
let l = cw_unpack_next_bin_lengh(unpacker.p)
let l = cw_unpack_next_bin_length(unpacker.p)
guard unpacker.OK else {throw CWPackError.unpackerError("Data")}
if l > 0 {self.init(bytes: unpacker.p.pointee.item.as.bin.start, count: Int(l))}
else {self.init()}
Expand All @@ -267,7 +267,7 @@ extension String: CWPackable {
}

init (_ unpacker: CWUnpacker) throws {
let l = cw_unpack_next_str_lengh(unpacker.p)
let l = cw_unpack_next_str_length(unpacker.p)
guard unpacker.OK else {throw CWPackError.unpackerError("String")}
if l > 0 {self.init(NSString(bytes: unpacker.p.pointee.item.as.str.start, length: Int(l), encoding: String.Encoding.utf8.rawValue)!)}
else {self.init()}
Expand Down

0 comments on commit 01d0012

Please sign in to comment.