Commit 4d41bdd1 authored by Joris Huizer's avatar Joris Huizer Committed by Alexandre Julliard

crypt32: Remove helper variable i (Clang).

parent 6816aa29
...@@ -498,14 +498,13 @@ static inline BYTE decodeBase64Byte(int c) ...@@ -498,14 +498,13 @@ static inline BYTE decodeBase64Byte(int c)
static LONG decodeBase64Block(const char *in_buf, int in_len, static LONG decodeBase64Block(const char *in_buf, int in_len,
const char **nextBlock, PBYTE out_buf, DWORD *out_len) const char **nextBlock, PBYTE out_buf, DWORD *out_len)
{ {
int len = in_len, i; int len = in_len;
const char *d = in_buf; const char *d = in_buf;
int ip0, ip1, ip2, ip3; int ip0, ip1, ip2, ip3;
if (len < 4) if (len < 4)
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
i = 0;
if (d[2] == '=') if (d[2] == '=')
{ {
if ((ip0 = decodeBase64Byte(d[0])) > 63) if ((ip0 = decodeBase64Byte(d[0])) > 63)
...@@ -514,8 +513,8 @@ static LONG decodeBase64Block(const char *in_buf, int in_len, ...@@ -514,8 +513,8 @@ static LONG decodeBase64Block(const char *in_buf, int in_len,
return ERROR_INVALID_DATA; return ERROR_INVALID_DATA;
if (out_buf) if (out_buf)
out_buf[i] = (ip0 << 2) | (ip1 >> 4); out_buf[0] = (ip0 << 2) | (ip1 >> 4);
i++; *out_len = 1;
} }
else if (d[3] == '=') else if (d[3] == '=')
{ {
...@@ -528,10 +527,10 @@ static LONG decodeBase64Block(const char *in_buf, int in_len, ...@@ -528,10 +527,10 @@ static LONG decodeBase64Block(const char *in_buf, int in_len,
if (out_buf) if (out_buf)
{ {
out_buf[i + 0] = (ip0 << 2) | (ip1 >> 4); out_buf[0] = (ip0 << 2) | (ip1 >> 4);
out_buf[i + 1] = (ip1 << 4) | (ip2 >> 2); out_buf[1] = (ip1 << 4) | (ip2 >> 2);
} }
i += 2; *out_len = 2;
} }
else else
{ {
...@@ -546,11 +545,11 @@ static LONG decodeBase64Block(const char *in_buf, int in_len, ...@@ -546,11 +545,11 @@ static LONG decodeBase64Block(const char *in_buf, int in_len,
if (out_buf) if (out_buf)
{ {
out_buf[i + 0] = (ip0 << 2) | (ip1 >> 4); out_buf[0] = (ip0 << 2) | (ip1 >> 4);
out_buf[i + 1] = (ip1 << 4) | (ip2 >> 2); out_buf[1] = (ip1 << 4) | (ip2 >> 2);
out_buf[i + 2] = (ip2 << 6) | ip3; out_buf[2] = (ip2 << 6) | ip3;
} }
i += 3; *out_len = 3;
} }
if (len >= 6 && d[4] == '\r' && d[5] == '\n') if (len >= 6 && d[4] == '\r' && d[5] == '\n')
*nextBlock = d + 6; *nextBlock = d + 6;
...@@ -560,7 +559,6 @@ static LONG decodeBase64Block(const char *in_buf, int in_len, ...@@ -560,7 +559,6 @@ static LONG decodeBase64Block(const char *in_buf, int in_len,
*nextBlock = d + 4; *nextBlock = d + 4;
else else
*nextBlock = NULL; *nextBlock = NULL;
*out_len = i;
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment