summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);