summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2022-01-20 14:18:11 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2022-01-20 14:18:11 +0000
commit8df65ba119d763e239ed7ff46de87e8bd9321fa5 (patch)
treed66a2e30445e674036146e04ef3b63103b12c3ae
parentb344443d2bcbd5741f2ba9deaa323f07b3471215 (diff)
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@
-rw-r--r--lib/libc/asr/asr.c6
-rw-r--r--regress/lib/libc/asr/bin/res_mkquery.c6
-rw-r--r--regress/lib/libc/asr/bin/res_query.c6
-rw-r--r--usr.sbin/smtpd/unpack_dns.c6
4 files changed, 12 insertions, 12 deletions
diff --git a/lib/libc/asr/asr.c b/lib/libc/asr/asr.c
index 7cbf6aab5c9..c4ee2dd103f 100644
--- a/lib/libc/asr/asr.c
+++ b/lib/libc/asr/asr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asr.c,v 1.67 2021/11/22 20:18:27 jca Exp $ */
+/* $OpenBSD: asr.c,v 1.68 2022/01/20 14:18:10 naddy Exp $ */
/*
* Copyright (c) 2010-2012 Eric Faurot <eric@openbsd.org>
*
@@ -853,7 +853,7 @@ _asr_strdname(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);
@@ -862,7 +862,7 @@ _asr_strdname(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/regress/lib/libc/asr/bin/res_mkquery.c b/regress/lib/libc/asr/bin/res_mkquery.c
index b32f471cdff..ed41e1120df 100644
--- a/regress/lib/libc/asr/bin/res_mkquery.c
+++ b/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 <eric@openbsd.org>
*
@@ -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/regress/lib/libc/asr/bin/res_query.c b/regress/lib/libc/asr/bin/res_query.c
index ca95a89a7cc..a2c3686ca35 100644
--- a/regress/lib/libc/asr/bin/res_query.c
+++ b/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 <eric@openbsd.org>
*
@@ -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;
diff --git a/usr.sbin/smtpd/unpack_dns.c b/usr.sbin/smtpd/unpack_dns.c
index fd7ec6ba6e0..2cde633cd98 100644
--- a/usr.sbin/smtpd/unpack_dns.c
+++ b/usr.sbin/smtpd/unpack_dns.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unpack_dns.c,v 1.2 2021/06/14 17:58:16 eric Exp $ */
+/* $OpenBSD: unpack_dns.c,v 1.3 2022/01/20 14:18:10 naddy Exp $ */
/*
* Copyright (c) 2011-2014 Eric Faurot <eric@faurot.net>
@@ -195,7 +195,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) {
(void)strlcpy(buf, ".", max);
@@ -204,7 +204,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;