summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/kit/bigint.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/kit/bigint.h b/source/kit/bigint.h
index 0347108..89610f4 100644
--- a/source/kit/bigint.h
+++ b/source/kit/bigint.h
@@ -480,7 +480,7 @@ static kit_bigint_t kit_bi_from_hex(kit_str_t hex) {
return z;
}
-static u8 KIT_BASE32_DIGITS[] = {
+static u8 KIT_BASE32_DIGITS[256] = {
['1'] = 0, ['2'] = 1, ['3'] = 2, ['4'] = 3, ['5'] = 4,
['6'] = 5, ['7'] = 6, ['8'] = 7, ['9'] = 8, ['a'] = 9,
['b'] = 10, ['c'] = 11, ['d'] = 12, ['e'] = 13, ['f'] = 14,
@@ -491,12 +491,9 @@ static u8 KIT_BASE32_DIGITS[] = {
};
static u8 kit_base32_digit(c8 c) {
- assert(c >= '\0' && c < (c8) sizeof KIT_BASE32_DIGITS);
assert(c == '1' || KIT_BASE32_DIGITS[(size_t) (u8) c] != 0);
- return c >= '\0' && c < (c8) sizeof KIT_BASE32_DIGITS
- ? KIT_BASE32_DIGITS[(size_t) (u8) c]
- : 0;
+ return KIT_BASE32_DIGITS[(size_t) (u8) c];
}
static kit_bigint_t kit_bi_from_base32(kit_str_t base32) {