summaryrefslogtreecommitdiff
path: root/lib/base64.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-10-14 09:44:06 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-10-14 09:44:06 +0200
commit628290b5e69be62ee2df3df8a88b506cf2f43d6b (patch)
tree58158c4ecca91ebb58818cabde49e54ca6d93dd6 /lib/base64.c
parentc2d5f2ef983f752fca654aba9bcd1383698bdc04 (diff)
downloadcurl-628290b5e69be62ee2df3df8a88b506cf2f43d6b.tar.gz
cleanups: reduce variable scope
cppcheck pointed these out.
Diffstat (limited to 'lib/base64.c')
-rw-r--r--lib/base64.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/base64.c b/lib/base64.c
index bd9ba35be..6b1eb7c9c 100644
--- a/lib/base64.c
+++ b/lib/base64.c
@@ -49,10 +49,10 @@ static size_t decodeQuantum(unsigned char *dest, const char *src)
{
size_t padding = 0;
const char *s, *p;
- unsigned long i, v, x = 0;
+ unsigned long i, x = 0;
for(i = 0, s = src; i < 4; i++, s++) {
- v = 0;
+ unsigned long v = 0;
if(*s == '=') {
x = (x << 6);
@@ -107,7 +107,6 @@ CURLcode Curl_base64_decode(const char *src,
size_t length = 0;
size_t padding = 0;
size_t i;
- size_t result;
size_t numQuantums;
size_t rawlen = 0;
unsigned char *pos;
@@ -151,7 +150,7 @@ CURLcode Curl_base64_decode(const char *src,
/* Decode the quantums */
for(i = 0; i < numQuantums; i++) {
- result = decodeQuantum(pos, src);
+ size_t result = decodeQuantum(pos, src);
if(!result) {
Curl_safefree(newstr);