From: Nikos Mavrogiannopoulos Date: Sun, 23 Nov 2014 07:47:41 +0000 (+0100) Subject: system-keys-win: use macros for the URL X-Git-Tag: gnutls_3_4_0~580 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54b0fb87f065320b42fe4b9fdd18f5348382b65b;p=thirdparty%2Fgnutls.git system-keys-win: use macros for the URL --- diff --git a/lib/system-keys-win.c b/lib/system-keys-win.c index 5133b3a21c..0a136329cf 100644 --- a/lib/system-keys-win.c +++ b/lib/system-keys-win.c @@ -116,6 +116,9 @@ static NCryptSignHashFunc pNCryptSignHash; static unsigned ncrypt_init = 0; static HMODULE ncrypt_lib; +#define WIN_URL "system:win:" +#define WIN_URL_SIZE 11 + static int get_id(const char *url, uint8_t *bin, size_t *bin_size, unsigned cert) { @@ -124,14 +127,14 @@ get_id(const char *url, uint8_t *bin, size_t *bin_size, unsigned cert) const char *p = url, *p2; if (cert != 0) { - if (url_size < sizeof("system:win:") || strncmp(url, "system:win:", 11) != 0) + if (url_size < sizeof(WIN_URL) || strncmp(url, WIN_URL, WIN_URL_SIZE) != 0) return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); } else { - if (url_size < sizeof("system:win:") || strncmp(url, "system:win:", 11) != 0) + if (url_size < sizeof(WIN_URL) || strncmp(url, WIN_URL, WIN_URL_SIZE) != 0) return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); } - p += sizeof("system:win:") - 1; + p += sizeof(WIN_URL) - 1; p = strstr(p, "id="); if (p == NULL)