summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-19 22:03:17 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-19 22:03:17 +0800
commit28a82f96d1296b6ce10b9edd838213aceada629f (patch)
tree928f8110170bba484b08cafccdef3f5e5c0bcabb
parent192f3079a496d5ac64a3465d5b207d40aa4b30db (diff)
Simplify y shop length retrieval
-rw-r--r--shopify.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/shopify.c b/shopify.c
index 0ca2627..aba2d9d 100644
--- a/shopify.c
+++ b/shopify.c
@@ -256,8 +256,7 @@ static enum MHD_Result handle_request(void *cls, struct MHD_Connection *con,
return MHD_NO;
}
pair = &pair[key_len];
- char *next = strchrnul(pair, '&');
- shop_len = sizeof(char) * (next - pair);
+ shop_len = (strchrnul(pair, '&') - pair) * sizeof(char);
shop = malloc(shop_len + 1);
strlcpy(shop, pair, shop_len + 1);
free(tofree);