git: d8482e1b3e14 - main - athpoke: Use a format string with err()

From: Adrian Chadd <adrian_at_FreeBSD.org>
Date: Fri, 28 Mar 2025 19:04:27 UTC
The branch main has been updated by adrian:

URL: https://cgit.FreeBSD.org/src/commit/?id=d8482e1b3e1473c7a8216f356bb978c792740a85

commit d8482e1b3e1473c7a8216f356bb978c792740a85
Author:     Adrian Chadd <adrian@FreeBSD.org>
AuthorDate: 2025-03-27 23:43:35 +0000
Commit:     Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2025-03-28 19:00:34 +0000

    athpoke: Use a format string with err()
    
    Don't do err(1, ptr); that's a very old security risk turned warning.
    
    Differential Revision:  https://reviews.freebsd.org/D49546
    Reviewed by:    thj
---
 tools/tools/ath/athpoke/athpoke.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/tools/ath/athpoke/athpoke.c b/tools/tools/ath/athpoke/athpoke.c
index e54388587ca8..02a21676e91f 100644
--- a/tools/tools/ath/athpoke/athpoke.c
+++ b/tools/tools/ath/athpoke/athpoke.c
@@ -89,7 +89,7 @@ main(int argc, char *argv[])
 	atd.ad_out_data = (caddr_t) &state.revs;
 	atd.ad_out_size = sizeof(state.revs);
 	if (ioctl(s, SIOCGATHDIAG, &atd) < 0)
-		err(1, atd.ad_name);
+		err(1, "%s", atd.ad_name);
 
 	argc -= optind;
 	argv += optind;
@@ -132,7 +132,7 @@ regread(int s, struct ath_diag *atd, uint32_t r)
 	atd->ad_out_size = sizeof(v);
 	atd->ad_id = HAL_DIAG_REGS | ATH_DIAG_IN | ATH_DIAG_DYN;
 	if (ioctl(s, SIOCGATHDIAG, atd) < 0)
-		err(1, atd->ad_name);
+		err(1, "%s", atd->ad_name);
 	return v[2];
 }
 
@@ -147,7 +147,7 @@ regwrite(int s, struct ath_diag *atd, uint32_t r, uint32_t v)
 	atd->ad_in_size = sizeof(rw);
 	atd->ad_id = HAL_DIAG_SETREGS | ATH_DIAG_IN;
 	if (ioctl(s, SIOCGATHDIAG, atd) < 0)
-		err(1, atd->ad_name);
+		err(1, "%s", atd->ad_name);
 }
 
 static int