diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-05-17 16:05:34 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-05-17 16:05:34 +0800 |
commit | a091012bc03a43a3d62dc35769889d4a6fd8517d (patch) | |
tree | 5f2978f1966ee676a64c6ead9fcef1e1e830df88 /ord.c | |
parent | 1e88f321279b60816a0fe3c78b9ac53facdd4203 (diff) |
Add prefix to custom option key
Diffstat (limited to 'ord.c')
-rw-r--r-- | ord.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -35,10 +35,11 @@ void interchange_ord_order(const char *sku, const char *item, order[2][1] = item; order[3][0] = "mv_order_quantity"; order[3][1] = qty_str; + static const char *prefix = "mv_order_"; for (size_t i = 0; i < nopts; i++) { const char **pair = options[i]; - order[4 + i][0] = malloc(strlen(pair[0]) + 1); - strcpy((char *)order[4 + i][0], pair[0]); + order[4 + i][0] = malloc(strlen(prefix) + strlen(pair[0]) + 1); + sprintf((char *)order[4 + i][0], "%s%s", prefix, pair[0]); order[4 + i][1] = malloc(strlen(pair[1]) + 1); strcpy((char *)order[4 + i][1], pair[1]); } |