From e26546db3ebce18ce33b6a6cf94bfefcd4e97e46 Mon Sep 17 00:00:00 2001 From: naddy Date: Mon, 17 Jan 2022 18:19:51 +0000 Subject: [PATCH] dig: fix -Wunused-but-set-variable warnings with and ok florian@ --- usr.bin/dig/lib/isc/lex.c | 5 +---- usr.bin/dig/lib/isc/sockaddr.c | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/usr.bin/dig/lib/isc/lex.c b/usr.bin/dig/lib/isc/lex.c index 30a05fc21ba..984c264c1b1 100644 --- a/usr.bin/dig/lib/isc/lex.c +++ b/usr.bin/dig/lib/isc/lex.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lex.c,v 1.13 2020/10/19 14:53:11 florian Exp $ */ +/* $Id: lex.c,v 1.14 2022/01/17 18:19:51 naddy Exp $ */ /*! \file */ @@ -289,7 +289,6 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { FILE *stream; char *curr, *prev; size_t remaining; - unsigned int saved_options; isc_result_t result; /* @@ -325,8 +324,6 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { isc_buffer_compact(source->pushback); - saved_options = options; - curr = lex->data; *curr = '\0'; diff --git a/usr.bin/dig/lib/isc/sockaddr.c b/usr.bin/dig/lib/isc/sockaddr.c index 6e83848f452..04dbd8e2c80 100644 --- a/usr.bin/dig/lib/isc/sockaddr.c +++ b/usr.bin/dig/lib/isc/sockaddr.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sockaddr.c,v 1.15 2020/12/21 11:41:09 florian Exp $ */ +/* $Id: sockaddr.c,v 1.16 2022/01/17 18:19:51 naddy Exp $ */ /*! \file */ #include @@ -109,7 +109,6 @@ isc_sockaddr_totext(const struct sockaddr_storage *sockaddr, isc_buffer_t *targe char pbuf[sizeof("65000")]; unsigned int plen; isc_region_t avail; - int error; char tmp[NI_MAXHOST]; REQUIRE(sockaddr != NULL); @@ -134,8 +133,9 @@ isc_sockaddr_totext(const struct sockaddr_storage *sockaddr, isc_buffer_t *targe plen = strlen(pbuf); INSIST(plen < sizeof(pbuf)); - error = getnameinfo((struct sockaddr *)sockaddr, sockaddr->ss_len, - tmp, sizeof(tmp), NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV); + if (getnameinfo((struct sockaddr *)sockaddr, sockaddr->ss_len, + tmp, sizeof(tmp), NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV) != 0) + return (ISC_R_FAILURE); if (strlen(tmp) > isc_buffer_availablelength(target)) return (ISC_R_NOSPACE); isc_buffer_putmem(target, tmp, strlen(tmp)); -- 2.20.1