diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <prabowo@darapsa.org> | 2022-10-05 20:39:39 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <prabowo@darapsa.org> | 2022-10-05 20:39:39 +0800 |
commit | d9c27a0221964924e77bab695d6c305a811adb73 (patch) | |
tree | f1f0cb9dcbe18693a42bc33f0747bc71c4c90667 /midtrans.c | |
parent | 74b5ca99a3ae4672e12b3ac4bdbfe369f1f58733 (diff) |
Make it portable to glibc
Diffstat (limited to 'midtrans.c')
-rw-r--r-- | midtrans.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -65,7 +65,8 @@ void midtrans_init(const char *api_key, const char *cainfo) char *pp; long base64_len = BIO_get_mem_data(b64, &pp) - 1; char base64[base64_len + 1]; - strlcpy(base64, pp, base64_len + 1); + strncpy(base64, pp, base64_len); + base64[base64_len] = '\0'; BIO_free_all(b64); static const char *hdr_tmpl = "Authorization: Basic %s"; |