From 4fef4145855fe4389bb078d92c77b0f792826844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Thu, 22 Sep 2022 16:54:11 +0800 Subject: Rename some vars --- shopify.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/shopify.c b/shopify.c index a15807c..8311ad7 100644 --- a/shopify.c +++ b/shopify.c @@ -237,16 +237,15 @@ static enum MHD_Result handle_request(void *cls, struct MHD_Connection *con, NULL); gcry_mac_setkey(hd, api_secret_key, strlen(api_secret_key)); gcry_mac_write(hd, query, strlen(query)); - static size_t hmacsha256_len = 32; - unsigned char hmacsha256[hmacsha256_len]; - gcry_mac_read(hd, hmacsha256, &hmacsha256_len); + static size_t hex_len = 32; + unsigned char hex[hex_len]; + gcry_mac_read(hd, hex, &hex_len); gcry_mac_close(hd); - char hmacsha256_str[hmacsha256_len * 2 + 1]; - hmacsha256_str[0] ='\0'; - for (size_t i = 0; i < hmacsha256_len; i++) - sprintf(hmacsha256_str, "%s%02x", hmacsha256_str, - hmacsha256[i]); - if (strcmp(hmac, hmacsha256_str)) { + char hmacsha256[hex_len * 2 + 1]; + hmacsha256[0] = '\0'; + for (size_t i = 0; i < hex_len; i++) + sprintf(hmacsha256, "%s%02x", hmacsha256, hex[i]); + if (strcmp(hmac, hmacsha256)) { free(query); clear(params); free(params); -- cgit v1.2.3