From 990bd319c696c2b65fa858b40fd75279fec2a13b Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Fri, 18 Nov 2022 23:40:08 -0500 Subject: txt2img functional --- lib/base64.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/base64.c b/lib/base64.c index 1e7e192..b6a8e5d 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -1,3 +1,5 @@ +// Slightly moulded by Fox to better suit his (poor?) tastes. + /* The compilation of software known as FreeBSD is distributed under the following terms: @@ -122,7 +124,7 @@ void base64_encode(const unsigned char *src, size_t len, * Caller is responsible for freeing the returned buffer. */ unsigned char * base64_decode(const unsigned char *src, size_t len, - size_t *out_len) + unsigned char *out_buffer, size_t *out_len) { unsigned char dtable[256], *out, *pos, block[4], tmp; size_t i, count, olen; @@ -148,11 +150,8 @@ unsigned char * base64_decode(const unsigned char *src, size_t len, return NULL; olen = count / 4 * 3; - // pos = out = os_malloc(olen); - pos = out = NULL; - Assert(0); - if (out == NULL) - return NULL; + pos = out = out_buffer; + Assert(out != NULL) count = 0; for (i = 0; i < len; i++) { -- cgit v1.2.3