summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-05-17 16:05:34 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-05-17 16:05:34 +0800
commita091012bc03a43a3d62dc35769889d4a6fd8517d (patch)
tree5f2978f1966ee676a64c6ead9fcef1e1e830df88
parent1e88f321279b60816a0fe3c78b9ac53facdd4203 (diff)
Add prefix to custom option key
-rw-r--r--ord.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ord.c b/ord.c
index df5017f..62112c6 100644
--- a/ord.c
+++ b/ord.c
@@ -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]);
}