]> git.ozlabs.org Git - ccan/commit - ccan/base64/base64.c
base64: fix for unsigned chars (e.g. ARM). master
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Aug 2023 01:43:53 +0000 (11:13 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Aug 2023 01:43:53 +0000 (11:13 +0930)
commitcd56b18ae87de6981b88abbe52544d8cc9f8aa0e
tree3af8f102339dcf869a6836c0ae93edc38f65b764
parent3beff01ae4dfb8b843bf5e78905fb8bc434cb270
base64: fix for unsigned chars (e.g. ARM).

```
ccan/ccan/base64/base64.c:34:10: error: result of comparison of constant 255 with expression of type 'int8_t' (aka 'signed char') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
        if (ret == (char)0xff) {
            ~~~ ^  ~~~~~~~~~~
ccan/ccan/base64/base64.c:44:57: error: result of comparison of constant 255 with expression of type 'const signed char' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
        return (maps->decode_map[(const unsigned char)b64char] != (char)0xff);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~
```

Reported-by: Christian Decker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/base64/base64.c