From 28a82f96d1296b6ce10b9edd838213aceada629f Mon Sep 17 00:00:00 2001 From: ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ Date: Mon, 19 Sep 2022 22:03:17 +0800 Subject: Simplify y shop length retrieval --- shopify.c | 3 +-- 1 file changed, 1 insertion(+), 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); -- cgit v1.3