mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
fix compiler warning
This commit is contained in:
parent
048438345a
commit
2179ef9fa9
14
lib/base64.c
14
lib/base64.c
@ -80,12 +80,12 @@ static void decodeQuantum(unsigned char *dest, const char *src)
|
|||||||
*/
|
*/
|
||||||
size_t Curl_base64_decode(const char *src, unsigned char **outptr)
|
size_t Curl_base64_decode(const char *src, unsigned char **outptr)
|
||||||
{
|
{
|
||||||
int length = 0;
|
size_t length = 0;
|
||||||
int equalsTerm = 0;
|
size_t equalsTerm = 0;
|
||||||
int i;
|
size_t i;
|
||||||
int numQuantums;
|
size_t numQuantums;
|
||||||
unsigned char lastQuantum[3];
|
unsigned char lastQuantum[3];
|
||||||
size_t rawlen=0;
|
size_t rawlen = 0;
|
||||||
unsigned char *newstr;
|
unsigned char *newstr;
|
||||||
|
|
||||||
*outptr = NULL;
|
*outptr = NULL;
|
||||||
@ -101,7 +101,7 @@ size_t Curl_base64_decode(const char *src, unsigned char **outptr)
|
|||||||
numQuantums = (length + equalsTerm) / 4;
|
numQuantums = (length + equalsTerm) / 4;
|
||||||
|
|
||||||
/* Don't allocate a buffer if the decoded length is 0 */
|
/* Don't allocate a buffer if the decoded length is 0 */
|
||||||
if(numQuantums <= 0)
|
if(numQuantums == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
rawlen = (numQuantums * 3) - equalsTerm;
|
rawlen = (numQuantums * 3) - equalsTerm;
|
||||||
@ -128,7 +128,7 @@ size_t Curl_base64_decode(const char *src, unsigned char **outptr)
|
|||||||
for(i = 0; i < 3 - equalsTerm; i++)
|
for(i = 0; i < 3 - equalsTerm; i++)
|
||||||
newstr[i] = lastQuantum[i];
|
newstr[i] = lastQuantum[i];
|
||||||
|
|
||||||
newstr[i] = 0; /* zero terminate */
|
newstr[i] = '\0'; /* zero terminate */
|
||||||
return rawlen;
|
return rawlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -871,7 +871,7 @@ static int dprintf_formatf(
|
|||||||
len = strlen(str);
|
len = strlen(str);
|
||||||
|
|
||||||
if(prec != -1 && (size_t) prec < len)
|
if(prec != -1 && (size_t) prec < len)
|
||||||
len = prec;
|
len = (size_t)prec;
|
||||||
width -= (long)len;
|
width -= (long)len;
|
||||||
|
|
||||||
if(p->flags & FLAGS_ALT)
|
if(p->flags & FLAGS_ALT)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user