X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fbase64.c;h=98d933a70dd0b23d4e837390068185a15554126f;hb=22c4089b345a2eaefd5bc70ef116e1301d91e8b1;hp=97b6019b9d3bb5efbd2646fa0f670e59ef638a61;hpb=112ca20edbdbbede4ffeac64892bb4fc5e1b04d6;p=gnulib.git diff --git a/lib/base64.c b/lib/base64.c index 97b6019b9..98d933a70 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -274,10 +274,10 @@ static const signed char b64[0x100] = { B64 (252), B64 (253), B64 (254), B64 (255) }; -static inline bool -isb64 (unsigned char ch) +bool +isbase64 (char ch) { - return ch <= 255 && 0 <= b64[ch]; + return to_uchar (ch) <= 255 && 0 <= b64[to_uchar (ch)]; } /* Decode base64 encoded input array IN of length INLEN to output @@ -295,7 +295,7 @@ base64_decode (const char *restrict in, size_t inlen, while (inlen >= 2) { - if (!isb64 (in[0]) || !isb64 (in[1])) + if (!isbase64 (in[0]) || !isbase64 (in[1])) break; if (outleft) @@ -319,7 +319,7 @@ base64_decode (const char *restrict in, size_t inlen, } else { - if (!isb64 (in[2])) + if (!isbase64 (in[2])) break; if (outleft) @@ -339,7 +339,7 @@ base64_decode (const char *restrict in, size_t inlen, } else { - if (!isb64 (in[3])) + if (!isbase64 (in[3])) break; if (outleft)