summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/asr
diff options
context:
space:
mode:
authornaddy <>2022-01-20 14:18:10 +0000
committernaddy <>2022-01-20 14:18:10 +0000
commit1138add7ea0f2eefc8170045c4c77a8b8325362d (patch)
treed51547a964fd7bf33785647d3f94a3e91218fed1 /src/regress/lib/libc/asr
parent37c6c98754980ebe15d1d307e5d5912f771f7157 (diff)
downloadopenbsd-1138add7ea0f2eefc8170045c4c77a8b8325362d.tar.gz
openbsd-1138add7ea0f2eefc8170045c4c77a8b8325362d.tar.bz2
openbsd-1138add7ea0f2eefc8170045c4c77a8b8325362d.zip
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@
Diffstat (limited to 'src/regress/lib/libc/asr')
-rw-r--r--src/regress/lib/libc/asr/bin/res_mkquery.c6
-rw-r--r--src/regress/lib/libc/asr/bin/res_query.c6
2 files changed, 6 insertions, 6 deletions
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 @@
1/* $OpenBSD: res_mkquery.c,v 1.2 2018/12/15 15:16:12 eric Exp $ */ 1/* $OpenBSD: res_mkquery.c,v 1.3 2022/01/20 14:18:10 naddy Exp $ */
2/* 2/*
3 * Copyright (c) 2012 Eric Faurot <eric@openbsd.org> 3 * Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
4 * 4 *
@@ -296,7 +296,7 @@ print_dname(const char *_dname, char *buf, size_t max)
296{ 296{
297 const unsigned char *dname = _dname; 297 const unsigned char *dname = _dname;
298 char *res; 298 char *res;
299 size_t left, n, count; 299 size_t left, count;
300 300
301 if (_dname[0] == 0) { 301 if (_dname[0] == 0) {
302 strlcpy(buf, ".", max); 302 strlcpy(buf, ".", max);
@@ -305,7 +305,7 @@ print_dname(const char *_dname, char *buf, size_t max)
305 305
306 res = buf; 306 res = buf;
307 left = max - 1; 307 left = max - 1;
308 for (n = 0; dname[0] && left; n += dname[0]) { 308 while (dname[0] && left) {
309 count = (dname[0] < (left - 1)) ? dname[0] : (left - 1); 309 count = (dname[0] < (left - 1)) ? dname[0] : (left - 1);
310 memmove(buf, dname + 1, count); 310 memmove(buf, dname + 1, count);
311 dname += dname[0] + 1; 311 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 @@
1/* $OpenBSD: res_query.c,v 1.3 2018/12/15 15:16:12 eric Exp $ */ 1/* $OpenBSD: res_query.c,v 1.4 2022/01/20 14:18:10 naddy Exp $ */
2/* 2/*
3 * Copyright (c) 2012 Eric Faurot <eric@openbsd.org> 3 * Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
4 * 4 *
@@ -332,7 +332,7 @@ print_dname(const char *_dname, char *buf, size_t max)
332{ 332{
333 const unsigned char *dname = _dname; 333 const unsigned char *dname = _dname;
334 char *res; 334 char *res;
335 size_t left, n, count; 335 size_t left, count;
336 336
337 if (_dname[0] == 0) { 337 if (_dname[0] == 0) {
338 strlcpy(buf, ".", max); 338 strlcpy(buf, ".", max);
@@ -341,7 +341,7 @@ print_dname(const char *_dname, char *buf, size_t max)
341 341
342 res = buf; 342 res = buf;
343 left = max - 1; 343 left = max - 1;
344 for (n = 0; dname[0] && left; n += dname[0]) { 344 while (dname[0] && left) {
345 count = (dname[0] < (left - 1)) ? dname[0] : (left - 1); 345 count = (dname[0] < (left - 1)) ? dname[0] : (left - 1);
346 memmove(buf, dname + 1, count); 346 memmove(buf, dname + 1, count);
347 dname += dname[0] + 1; 347 dname += dname[0] + 1;