From 4a0e2af2fd22903fedb73ec9cfcc6a1dbe787442 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, 15 Sep 2022 09:24:18 +0800 Subject: Change crypt_getnonce char * argument type Rename it to char buf[], to make it clearer how it should be used. --- crypt.h | 8 ++++---- shopify.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crypt.h b/crypt.h index 5efe114..57d4689 100644 --- a/crypt.h +++ b/crypt.h @@ -24,12 +24,12 @@ static inline bool crypt_maccmp(const char *key, const char *query, return !strcmp(hmac, hmacsha256_str); } -static inline void crypt_getnonce(char *string, const size_t string_len) +static inline void crypt_getnonce(char buf[], const size_t buf_len) { - string[0] = '\0'; - const size_t nonce_len = string_len / 2; + buf[0] = '\0'; + const size_t nonce_len = buf_len / 2; unsigned char nonce[nonce_len + 1]; gcry_create_nonce(nonce, nonce_len); for (int i = 0; i < nonce_len; i++) - sprintf(string, "%s%02x", string, nonce[i]); + sprintf(buf, "%s%02x", buf, nonce[i]); } diff --git a/shopify.c b/shopify.c index a718ecf..653c11e 100644 --- a/shopify.c +++ b/shopify.c @@ -43,7 +43,7 @@ extern inline void crypt_init(); extern inline bool crypt_maccmp(const char *, const char *, const char *); -extern inline void crypt_getnonce(char *, const size_t); +extern inline void crypt_getnonce(char [], const size_t); extern inline bool regex_match(const char *); extern inline void base64_decode(unsigned char *, char **); extern inline void config_getscopes(const char *, char **); -- cgit v1.2.3