From ec96facc7f06f5e2da3b0ced68a72472025ad7d4 Mon Sep 17 00:00:00 2001 From: chris mikkelson Date: Tue, 20 Apr 2010 07:47:49 -0500 Subject: [PATCH] Cast signed char to unsigned char, not unsigned int for array ref. --- base64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base64.c b/base64.c index 4c0de2e..46563b1 100644 --- a/base64.c +++ b/base64.c @@ -37,7 +37,7 @@ base64_init(void) for (i = 0; i < 256; i++) i64[i] = -1; for (p = b64c, i = 0; *p; p++, i++) - i64[(unsigned int)*p] = i; + i64[(unsigned char)*p] = i; i64['='] = 0; } @@ -85,7 +85,7 @@ b64_decode(struct b64_state *b64s, char *s, int len, if (size < 3) goto done; for (; v < 4; v++) { if (p >= s + len) goto done; - l = i64[(unsigned int)*p++]; + l = i64[(unsigned char)*p++]; if (l < 0) return -1; u <<= 6; u |= l; -- 2.50.1