Skip to content

Commit

Permalink
Fix build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
WindowsMEMZ committed Jan 12, 2024
1 parent 890572d commit 0faf411
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DarockBili Watch App/Extension/CodeExt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func bv2av(bvid: String) -> UInt64 {
return (tmp & MASK_CODE) ^ XOR_CODE
}


enum BuvidFpError: Error {
case readError
}
Expand Down Expand Up @@ -298,8 +299,9 @@ struct BuvidFp {
let remaining = key.distance(from: index, to: key.endIndex)
let read = min(remaining, 16)

withUnsafeMutableBytes(of: &buf) { buffer in
key.copyBytes(to: buffer, from: index..<key.index(index, offsetBy: read))
_ = key.withCString { cString in
// Using withCString to convert the Swift String to a C-style string
memcpy(&buf, cString + index.utf16Offset(in: key), read)
}

processed += read
Expand Down

0 comments on commit 0faf411

Please sign in to comment.