mirror of
https://github.com/curl/curl.git
synced 2026-08-26 11:23:35 +03:00
fix compiler warning
This commit is contained in:
parent
2179ef9fa9
commit
a6fb6b70c7
3 changed files with 15 additions and 9 deletions
18
lib/base64.c
18
lib/base64.c
|
|
@ -54,22 +54,28 @@ static const char table64[]=
|
|||
|
||||
static void decodeQuantum(unsigned char *dest, const char *src)
|
||||
{
|
||||
unsigned int x = 0;
|
||||
unsigned long x = 0;
|
||||
int i;
|
||||
char *found;
|
||||
union {
|
||||
unsigned long uns;
|
||||
long sig;
|
||||
} offset;
|
||||
|
||||
for(i = 0; i < 4; i++) {
|
||||
if((found = strchr(table64, src[i])) != NULL)
|
||||
x = (x << 6) + (unsigned int)(found - table64);
|
||||
if((found = strchr(table64, src[i])) != NULL) {
|
||||
offset.sig = found - table64;
|
||||
x = (x << 6) + offset.uns;
|
||||
}
|
||||
else if(src[i] == '=')
|
||||
x = (x << 6);
|
||||
}
|
||||
|
||||
dest[2] = (unsigned char)(x & 255);
|
||||
dest[2] = (unsigned char)(x & 0xFFUL);
|
||||
x >>= 8;
|
||||
dest[1] = (unsigned char)(x & 255);
|
||||
dest[1] = (unsigned char)(x & 0xFFUL);
|
||||
x >>= 8;
|
||||
dest[0] = (unsigned char)(x & 255);
|
||||
dest[0] = (unsigned char)(x & 0xFFUL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue