Fix copyright year issues
[openssl.git] / crypto / punycode.c
index 2607d6157a8c24d8afefecdcf90c9312b4babdff..f6d7ff7960e25b67e1377187ecf061fca19f4fa1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,10 +8,10 @@
  */
 
 #include <stddef.h>
-#include <string.h>
 #include <stdio.h>
 #include <openssl/e_os2.h>
 #include "crypto/punycode.h"
+#include "internal/common.h" /* for HAS_PREFIX */
 
 static const unsigned int base = 36;
 static const unsigned int tmin = 1;
@@ -266,7 +266,7 @@ int ossl_a2ulabel(const char *in, char *out, size_t *outlen)
         char *tmpptr = strchr(inptr, '.');
         size_t delta = (tmpptr) ? (size_t)(tmpptr - inptr) : strlen(inptr);
 
-        if (strncmp(inptr, "xn--", 4) != 0) {
+        if (!HAS_PREFIX(inptr, "xn--")) {
             size += delta + 1;
 
             if (size >= *outlen - 1)