From: Arran Cudbard-Bell Date: Wed, 15 Jul 2015 01:57:53 +0000 (-0400) Subject: s/fr_isbase64/fr_is_base64 X-Git-Tag: release_3_0_10~337 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=409f77a8a46acf1d9faafd34c3e3f57d4ae4aa2a;p=thirdparty%2Ffreeradius-server.git s/fr_isbase64/fr_is_base64 --- diff --git a/src/include/base64.h b/src/include/base64.h index e12d457653d..ca3e0ca1629 100644 --- a/src/include/base64.h +++ b/src/include/base64.h @@ -29,7 +29,7 @@ RCSIDH(base64_h, "$Id$") #define FR_BASE64_ENC_LENGTH(inlen) ((((inlen) + 2) / 3) * 4) #define FR_BASE64_DEC_LENGTH(inlen) ((3 * (inlen / 4)) + 2) -int fr_isbase64(char c); +bool fr_is_base64(char c); size_t fr_base64_encode(char *out, size_t outlen, uint8_t const *in, size_t inlen); diff --git a/src/lib/base64.c b/src/lib/base64.c index 85dd94dca27..7e33a946f99 100644 --- a/src/lib/base64.c +++ b/src/lib/base64.c @@ -218,7 +218,7 @@ static const signed char b64[0x100] = { * @return true if CH is a character from the Base64 alphabet, and false * otherwise. */ -int fr_isbase64(char c) +bool fr_is_base64(char c) { return b64[us(c)] >= 0; } @@ -253,7 +253,7 @@ ssize_t fr_base64_decode(uint8_t *out, size_t outlen, char const *in, size_t inl } while (inlen >= 2) { - if (!fr_isbase64(in[0]) || !fr_isbase64(in[1])) { + if (!fr_is_base64(in[0]) || !fr_is_base64(in[1])) { break; } @@ -264,7 +264,7 @@ ssize_t fr_base64_decode(uint8_t *out, size_t outlen, char const *in, size_t inl if (in[2] == '=') { if ((inlen != 4) || (in[3] != '=')) break; } else { - if (!fr_isbase64(in[2])) break; + if (!fr_is_base64(in[2])) break; *p++ = ((b64[us(in[1])] << 4) & 0xf0) | (b64[us(in[2])] >> 2); @@ -273,7 +273,7 @@ ssize_t fr_base64_decode(uint8_t *out, size_t outlen, char const *in, size_t inl if (in[3] == '=') { if (inlen != 4) break; } else { - if (!fr_isbase64(in[3])) break; + if (!fr_is_base64(in[3])) break; *p++ = ((b64[us(in[2])] << 6) & 0xc0) | b64[us(in[3])]; }