commit 6b294cd251df815764a4ea9fa59119d96c777daa
parent 443ceb206800065abd5d5bbffc7abb43e980449f
Author: Joel Klabo <joelklabo@gmail.com>
Date: Tue, 29 Mar 2022 16:01:08 -0700
Change Type of withMemoryRebound to CChar
Closes #3
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lightninglink/LNUrl.swift b/lightninglink/LNUrl.swift
@@ -59,7 +59,7 @@ func decode_bech32(_ str: String) -> Bech32? {
var m_data: Data? = nil
var typ: bech32_encoding = BECH32_ENCODING_NONE
- hrp_buf.withMemoryRebound(to: UInt8.self) { hrp_ptr in
+ hrp_buf.withMemoryRebound(to: CChar.self) { hrp_ptr in
str.withCString { input in
typ = bech32_decode(hrp_ptr.baseAddress, bits_buf.baseAddress, &bitslen, input, str.count)
bech32_convert_bits(data_buf.baseAddress, &datalen, 8, bits_buf.baseAddress, bitslen, 5, 0)