summaryrefslogtreecommitdiff
path: root/midtrans.c
diff options
context:
space:
mode:
Diffstat (limited to 'midtrans.c')
-rw-r--r--midtrans.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/midtrans.c b/midtrans.c
index e0d0b31..e3f3a77 100644
--- a/midtrans.c
+++ b/midtrans.c
@@ -41,7 +41,7 @@ void midtrans_init(_Bool production, const char *api_key, const char *cainfo)
BIO_write(b64, basic, basic_len);
BIO_flush(b64);
char *pp;
- long base64_len = BIO_get_mem_data(b64, &pp);
+ long base64_len = BIO_get_mem_data(b64, &pp) - 1;
char base64[base64_len + 1];
strlcpy(base64, pp, base64_len + 1);
BIO_free_all(b64);