diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-05-15 10:43:46 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-05-15 10:43:46 +0800 |
commit | 42ad93d1f6e7dbca2264c2cf62db3b8c79a5120b (patch) | |
tree | ef64244afb7df437e848ae1642424324d21fd7ed /ord.c | |
parent | 33c252c6b2f509b6420c24d610dd99a15cda5593 (diff) |
POST copies contents so quantity doesn't leak
Diffstat (limited to 'ord.c')
-rw-r--r-- | ord.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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" }, |