diff options
author | Yang Tse <yangsita@gmail.com> | 2010-02-20 01:15:10 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-02-20 01:15:10 +0000 |
commit | 2179ef9fa914c916b3f6e35519091d3e72b75d2c (patch) | |
tree | e44416de6a4050d171278e678c0fdaa93313744c /lib/base64.c | |
parent | 048438345aed2acbb044e107946a804bc2d02363 (diff) | |
download | curl-2179ef9fa914c916b3f6e35519091d3e72b75d2c.tar.gz |
fix compiler warning
Diffstat (limited to 'lib/base64.c')
-rw-r--r-- | lib/base64.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/base64.c b/lib/base64.c index 042caef71..26d89231e 100644 --- a/lib/base64.c +++ b/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) { - int length = 0; - int equalsTerm = 0; - int i; - int numQuantums; + size_t length = 0; + size_t equalsTerm = 0; + size_t i; + size_t numQuantums; unsigned char lastQuantum[3]; - size_t rawlen=0; + size_t rawlen = 0; unsigned char *newstr; *outptr = NULL; @@ -101,7 +101,7 @@ size_t Curl_base64_decode(const char *src, unsigned char **outptr) numQuantums = (length + equalsTerm) / 4; /* Don't allocate a buffer if the decoded length is 0 */ - if(numQuantums <= 0) + if(numQuantums == 0) return 0; 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++) newstr[i] = lastQuantum[i]; - newstr[i] = 0; /* zero terminate */ + newstr[i] = '\0'; /* zero terminate */ return rawlen; } |