/*
- * 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
*/
#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;
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)