summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <prabowo@darapsa.org>2022-10-05 17:56:51 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <prabowo@darapsa.org>2022-10-05 17:56:51 +0800
commit1c7e8d93fbb4f131250f737b11a8ad99df167ea8 (patch)
tree3e10804377de3f591d8e283d4d54bf4a84efce53
parentb7086a2580131680a74d4b56bbf0f26085c6bab6 (diff)
BIO_get_mem_* seems to contain \n
-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);