mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 16:14:23 +01:00
Remove tal_len, use tal_count() or tal_bytelen().
tal_count() is used where there's a type, even if it's char or u8, and tal_bytelen() is going to replace tal_len() for clarity: it's only needed where a pointer is void. We shim tal_bytelen() for now. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
eae9b81099
commit
5cf34d6618
@@ -9,7 +9,7 @@ char *b32_encode(const tal_t *ctx, const void *data, size_t len)
|
||||
char *str = tal_arr(ctx, char, base32_str_size(len));
|
||||
|
||||
base32_chars = base32_lower;
|
||||
base32_encode(data, len, str, tal_len(str));
|
||||
base32_encode(data, len, str, tal_count(str));
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ u8 *b32_decode(const tal_t *ctx, const char *str, size_t len)
|
||||
u8 *ret = tal_arr(ctx, u8, base32_data_size(str, len));
|
||||
|
||||
base32_chars = base32_lower;
|
||||
if (!base32_decode(str, len, ret, tal_len(ret)))
|
||||
if (!base32_decode(str, len, ret, tal_count(ret)))
|
||||
return tal_free(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user