summaryrefslogtreecommitdiff
path: root/ord.c
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-05-15 10:43:46 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-05-15 10:43:46 +0800
commit42ad93d1f6e7dbca2264c2cf62db3b8c79a5120b (patch)
treeef64244afb7df437e848ae1642424324d21fd7ed /ord.c
parent33c252c6b2f509b6420c24d610dd99a15cda5593 (diff)
POST copies contents so quantity doesn't leak
Diffstat (limited to 'ord.c')
-rw-r--r--ord.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ord.c b/ord.c
index 06d1798..4964931 100644
--- a/ord.c
+++ b/ord.c
@@ -15,7 +15,7 @@ void interchange_ord_order(const char *sku, const char *item,
do {
length++;
} while ((qty /= 10));
- char qty_str[length + 1];
+ char *qty_str = malloc(length + 1);
sprintf(qty_str, "%d", quantity);
request(parser, NULL, &(struct body){ 4, {
{ "mv_action", "refresh" },
@@ -34,7 +34,7 @@ void interchange_ord_update(const char *name, const unsigned int quantity,
do {
length++;
} while ((qty /= 10));
- char qty_str[length + 1];
+ char *qty_str = malloc(length + 1);
sprintf(qty_str, "%d", quantity);
request(parser, NULL, &(struct body){ 4 + (nextpage ? 1 : 0), {
{ "mv_quantity_update", "1" },