summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2019-12-19 12:23:34 +0100
committerTim Rühsen <tim.ruehsen@gmx.de>2020-01-03 11:34:37 +0100
commit8592153f7620133b0695df8d7e4864cd70bad6f6 (patch)
tree3d20bdb148aababd9a07c246b8c225e8ee16cc32 /src
parent348c2b66ef3e7712103c7bb15bf9569a6f957e9e (diff)
downloadgnutls-8592153f7620133b0695df8d7e4864cd70bad6f6.tar.gz
certtool-cfg.c: Silence -Wunused-variable if HAVE_IPV6 not set
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
Diffstat (limited to 'src')
-rw-r--r--src/certtool-cfg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/certtool-cfg.c b/src/certtool-cfg.c
index 75e1e57c54..fbbb4c6ab9 100644
--- a/src/certtool-cfg.c
+++ b/src/certtool-cfg.c
@@ -1880,10 +1880,11 @@ int get_tls_server_status(void)
/* convert a printable IP to binary */
static int string_to_ip(unsigned char *ip, const char *str)
{
- int len = strlen(str);
int ret;
#if HAVE_IPV6
+ int len = strlen(str);
+
if (strchr(str, ':') != NULL || len > 16) { /* IPv6 */
ret = inet_pton(AF_INET6, str, ip);
if (ret <= 0) {