From 1138add7ea0f2eefc8170045c4c77a8b8325362d Mon Sep 17 00:00:00 2001 From: naddy <> Date: Thu, 20 Jan 2022 14:18:10 +0000 Subject: remove unused variable from all copies of _asr_strdname() ... including those inlined into print_dname(). This also fixes -Wunused-but-set-variable warnings warnings in smtpd and smtpctl. The code was imported with asr and then copied around. ok deraadt@ guenther@ --- src/regress/lib/libc/asr/bin/res_mkquery.c | 6 +++--- src/regress/lib/libc/asr/bin/res_query.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/regress/lib/libc') diff --git a/src/regress/lib/libc/asr/bin/res_mkquery.c b/src/regress/lib/libc/asr/bin/res_mkquery.c index b32f471cdf..ed41e1120d 100644 --- a/src/regress/lib/libc/asr/bin/res_mkquery.c +++ b/src/regress/lib/libc/asr/bin/res_mkquery.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_mkquery.c,v 1.2 2018/12/15 15:16:12 eric Exp $ */ +/* $OpenBSD: res_mkquery.c,v 1.3 2022/01/20 14:18:10 naddy Exp $ */ /* * Copyright (c) 2012 Eric Faurot * @@ -296,7 +296,7 @@ print_dname(const char *_dname, char *buf, size_t max) { const unsigned char *dname = _dname; char *res; - size_t left, n, count; + size_t left, count; if (_dname[0] == 0) { strlcpy(buf, ".", max); @@ -305,7 +305,7 @@ print_dname(const char *_dname, char *buf, size_t max) res = buf; left = max - 1; - for (n = 0; dname[0] && left; n += dname[0]) { + while (dname[0] && left) { count = (dname[0] < (left - 1)) ? dname[0] : (left - 1); memmove(buf, dname + 1, count); dname += dname[0] + 1; diff --git a/src/regress/lib/libc/asr/bin/res_query.c b/src/regress/lib/libc/asr/bin/res_query.c index ca95a89a7c..a2c3686ca3 100644 --- a/src/regress/lib/libc/asr/bin/res_query.c +++ b/src/regress/lib/libc/asr/bin/res_query.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_query.c,v 1.3 2018/12/15 15:16:12 eric Exp $ */ +/* $OpenBSD: res_query.c,v 1.4 2022/01/20 14:18:10 naddy Exp $ */ /* * Copyright (c) 2012 Eric Faurot * @@ -332,7 +332,7 @@ print_dname(const char *_dname, char *buf, size_t max) { const unsigned char *dname = _dname; char *res; - size_t left, n, count; + size_t left, count; if (_dname[0] == 0) { strlcpy(buf, ".", max); @@ -341,7 +341,7 @@ print_dname(const char *_dname, char *buf, size_t max) res = buf; left = max - 1; - for (n = 0; dname[0] && left; n += dname[0]) { + while (dname[0] && left) { count = (dname[0] < (left - 1)) ? dname[0] : (left - 1); memmove(buf, dname + 1, count); dname += dname[0] + 1; -- cgit v1.2.3-55-g6feb