From 5f1f5a002ce57c5622e551078f77296aa440c1ca Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 2 Aug 2023 05:57:30 +0930 Subject: [PATCH] base64: really fix. Playing games with chars is always a bad idea, but this time for sure! Signed-off-by: Rusty Russell --- ccan/base64/base64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ccan/base64/base64.c b/ccan/base64/base64.c index c28e0da2..89e0d38b 100644 --- a/ccan/base64/base64.c +++ b/ccan/base64/base64.c @@ -31,7 +31,7 @@ static int8_t sixbit_from_b64(const base64_maps_t *maps, int8_t ret; ret = maps->decode_map[(unsigned char)b64letter]; - if (ret == '\xff') { + if (ret == (int8_t)'\xff') { errno = EDOM; return -1; } @@ -41,7 +41,7 @@ static int8_t sixbit_from_b64(const base64_maps_t *maps, bool base64_char_in_alphabet(const base64_maps_t *maps, const char b64char) { - return (maps->decode_map[(const unsigned char)b64char] != '\xff'); + return (maps->decode_map[(const unsigned char)b64char] != (signed char)'\xff'); } void base64_init_maps(base64_maps_t *dest, const char src[64]) -- 2.39.5