aboutsummaryrefslogtreecommitdiffstats
path: root/src/base64.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base64.c')
-rw-r--r--src/base64.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/base64.c b/src/base64.c
index d07ea60..eea847a 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -177,7 +177,8 @@ unsigned char * b64t_encode(const unsigned char *src, size_t len,
new_index ++;
}
}
- out[new_index] = 0;
+ if(new_index)
+ out[new_index] = 0;
*out_len = new_index;
for (size_t i=0; i < *out_len; i++) {