From: Andre Noll <maan@tuebingen.mpg.de>
Date: Wed, 29 Apr 2015 17:02:20 +0000 (+0200)
Subject: base64: Replace Pad64 variable by macro.
X-Git-Tag: v0.5.7~20^2~3
X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=6f97ddef03af932b5b0466499e8fe9c336c9abf4;p=paraslash.git

base64: Replace Pad64 variable by macro.

There is no need to define a variable for this.
---

diff --git a/base64.c b/base64.c
index 382f1519..9188e92b 100644
--- a/base64.c
+++ b/base64.c
@@ -15,11 +15,11 @@
 
 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.
  *
@@ -59,7 +59,7 @@ int base64_decode(char const *src, size_t encoded_size, char **result,
 		if (para_isspace(ch)) /* Skip whitespace anywhere. */
 			continue;
 
-		if (ch == Pad64)
+		if (ch == PAD64)
 			break;
 
 		pos = strchr(Base64, ch);
@@ -96,7 +96,7 @@ int base64_decode(char const *src, size_t encoded_size, char **result,
 	 * 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 */
@@ -109,7 +109,7 @@ int base64_decode(char const *src, size_t encoded_size, char **result,
 				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. */