diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-19 22:03:17 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-19 22:03:17 +0800 |
commit | 28a82f96d1296b6ce10b9edd838213aceada629f (patch) | |
tree | 928f8110170bba484b08cafccdef3f5e5c0bcabb | |
parent | 192f3079a496d5ac64a3465d5b207d40aa4b30db (diff) |
Simplify y shop length retrieval
-rw-r--r-- | shopify.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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); |