diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-10-06 21:48:08 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-10-06 21:48:08 +0800 |
commit | b36bcf5e0345b8d3dec427261d10450a4eae0b46 (patch) | |
tree | 2ea32def2dd2ec1633cac01915517a72a9c5c7c8 /midtrans.c | |
parent | 96b9c07f99afabaa6506547acf7ab04ae78851fd (diff) |
custom_fields can be NULL
Diffstat (limited to 'midtrans.c')
-rw-r--r-- | midtrans.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -148,7 +148,8 @@ void midtrans_charge(enum midtrans_payment type, void *object, char *fields = NULL; static const char *field_tmpl = "\n\t\"%s\": \"%s\","; const size_t field_static_len = strlen(field_tmpl) - strlen("%s") * 2; - while (i < 5 && custom_fields[i] && custom_fields[i + 1]) { + while (i < 5 && custom_fields && custom_fields[i] + && custom_fields[i + 1]) { size_t field_len = field_static_len + strlen(custom_fields[i]) + strlen(custom_fields[i + 1]); char field[field_len + 1]; |