summaryrefslogtreecommitdiff
path: root/lib/base64.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base64.c')
-rw-r--r--lib/base64.c11
1 files changed, 5 insertions, 6 deletions
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++) {