From 83f076d3a81e5a625c07fdaf82a5e598a1c75c71 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 14 Aug 2011 20:39:43 -0500 Subject: Update base64 PolarSSL code Also adjust our code using it for the size_t adjustments made by upstream. Signed-off-by: Dan McGee --- lib/libalpm/base64.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/libalpm/base64.h') diff --git a/lib/libalpm/base64.h b/lib/libalpm/base64.h index 0ae9612c..406aefa1 100644 --- a/lib/libalpm/base64.h +++ b/lib/libalpm/base64.h @@ -25,8 +25,10 @@ #ifndef _BASE64_H #define _BASE64_H -#define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL 0x0010 -#define POLARSSL_ERR_BASE64_INVALID_CHARACTER 0x0012 +#include + +#define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL -0x0010 /**< Output buffer too small. */ +#define POLARSSL_ERR_BASE64_INVALID_CHARACTER -0x0012 /**< Invalid character in input. */ /** * \brief Encode a buffer into base64 format @@ -43,8 +45,8 @@ * \note Call this function with *dlen = 0 to obtain the * required buffer size in *dlen */ -int base64_encode( unsigned char *dst, int *dlen, - const unsigned char *src, int slen ); +int base64_encode( unsigned char *dst, size_t *dlen, + const unsigned char *src, size_t slen ); /** * \brief Decode a base64-formatted buffer @@ -62,7 +64,7 @@ int base64_encode( unsigned char *dst, int *dlen, * \note Call this function with *dlen = 0 to obtain the * required buffer size in *dlen */ -int base64_decode( unsigned char *dst, int *dlen, - const unsigned char *src, int slen ); +int base64_decode( unsigned char *dst, size_t *dlen, + const unsigned char *src, size_t slen ); #endif /* base64.h */ -- cgit v1.2.3-24-g4f1b