static const char Base64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static const char Pad64 = '=';
/** Maximal possible size of the decoded data. */
#define BASE64_MAX_DECODED_SIZE(_encoded_size) ((_encoded_size) / 4 * 3)
+#define PAD64 '='
/**
* base64-decode a buffer.
*
if (para_isspace(ch)) /* Skip whitespace anywhere. */
continue;
- if (ch == Pad64)
+ if (ch == PAD64)
break;
pos = strchr(Base64, ch);
* on a byte boundary, and/or with erroneous trailing characters.
*/
- if (*src == Pad64) { /* We got a pad char. */
+ if (*src == PAD64) { /* We got a pad char. */
ch = *src++; /* Skip it, get next. */
switch (state) {
case 0: /* Invalid = in first position */
if (!isspace(ch))
break;
/* Make sure there is another trailing = sign. */
- if (ch != Pad64)
+ if (ch != PAD64)
goto fail;
ch = *src++; /* Skip the = */
/* Fall through to "single trailing =" case. */