Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/ELFKit/Extension/String+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ extension String {
typealias UInt8Tuple16 = (UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)

init(tuple: UInt8Tuple16) {
var buffer = tuple
self = withUnsafePointer(to: &buffer.0) {
let data = Data(bytes: $0, count: 16) + [0]
return String(cString: data)!
self = withUnsafePointer(to: tuple) {
let size = MemoryLayout<UInt8Tuple16>.size
let data = Data(bytes: $0, count: size) + [0]
return String(cString: data) ?? ""
}
}
}
Expand Down