summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base64.h6
-rw-r--r--shopify.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/base64.h b/base64.h
index 8533af1..3c735bc 100644
--- a/base64.h
+++ b/base64.h
@@ -1,11 +1,11 @@
#include <gnutls/gnutls.h>
-static inline void base64_decode(unsigned char *host, char **decoded_host)
+static inline void base64_decode(const char *host, char **decoded_host)
{
gnutls_datum_t result;
gnutls_base64_decode2(&(gnutls_datum_t){
- host,
- strlen((const char *)host)
+ (unsigned char *)host,
+ strlen(host)
}, &result);
*decoded_host = malloc(result.size + 1);
strlcpy(*decoded_host, (const char *)result.data, result.size + 1);
diff --git a/shopify.c b/shopify.c
index cb73201..f75b8ac 100644
--- a/shopify.c
+++ b/shopify.c
@@ -45,7 +45,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 bool regex_match(const char *);
-extern inline void base64_decode(unsigned char *, char **);
+extern inline void base64_decode(const char *, char **);
extern inline void config_getscopes(const char *, char **);
extern inline void request_init();
extern inline void request_token(const char *, const char *, const char *,
@@ -193,7 +193,7 @@ enum MHD_Result shopify_respond(const struct shopify_param params[],
sizeof(struct shopify_param), keycmp);
bool embedded = param && !strcmp(param->val, "1");
char *decoded_host;
- base64_decode((unsigned char *)host, &decoded_host);
+ base64_decode(host, &decoded_host);
int nsessions = 0;
while (sessions[nsessions].shop)
nsessions++;