From c07ab17d59f9f897ce427eaf5910135d03079ece Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sat, 6 Jun 2009 10:09:52 +0000 Subject: nixio: Use correct datatypes for base64 encode --- libs/nixio/src/binary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/nixio/src') diff --git a/libs/nixio/src/binary.c b/libs/nixio/src/binary.c index 2466f98917..c2de388173 100644 --- a/libs/nixio/src/binary.c +++ b/libs/nixio/src/binary.c @@ -192,7 +192,7 @@ static int nixio_bin_unhexlify(lua_State *L) { static int nixio_bin_b64encode(lua_State *L) { size_t len, lenout, pad, i; - const char *data = luaL_checklstring(L, 1, &len); + const uint8_t *data = (const uint8_t*)luaL_checklstring(L, 1, &len); lenout = len / 3; lenout *= 4; @@ -213,7 +213,7 @@ static int nixio_bin_b64encode(lua_State *L) { return luaL_error(L, NIXIO_OOM); } - char *o = out; + uint8_t *o = (uint8_t*)out; for (i = 0; i < len; i += 3) { uint32_t cv = (data[i] << 16) | (data[i+1] << 8) | data[i+2]; *(o+3) = nixio__b64encode_tbl[ cv & 0x3f]; -- cgit v1.2.3