NetBSD Problem Report #59667

From www@netbsd.org  Tue Sep 23 06:58:26 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 07C0F1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 23 Sep 2025 06:58:26 +0000 (UTC)
Message-Id: <20250923065824.754A11A923D@mollari.NetBSD.org>
Date: Tue, 23 Sep 2025 06:58:24 +0000 (UTC)
From: rvp@SDF.ORG
Reply-To: rvp@SDF.ORG
To: gnats-bugs@NetBSD.org
Subject: hdaudioctl(8): nid format differs between `show' and `get' commands.
X-Send-Pr-Version: www-1.0

>Number:         59667
>Category:       bin
>Synopsis:       hdaudioctl(8): nid format differs between `show' and `get' commands.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 23 07:00:00 +0000 2025
>Originator:     RVP
>Release:        HEAD, 11, 10, 9
>Organization:
>Environment:
NetBSD/amd64 11.99.3
>Description:
`hdaudioctl show <codecid> <nid>' prints the `nid' in hex, while in the
XML produced by `hdaudioctl get <codecid> <nid>' these are decimal.

Make this consistent to save some mental gymnastics.
>How-To-Repeat:
Compare the `nid' values between `show' and `get' (or `set').
>Fix:
Make `hdaudioctl show' print the <nid>s in decimal like `get'.

```
diff -urN hdaudioctl.orig/hdaudioctl.c hdaudioctl/hdaudioctl.c
--- hdaudioctl.orig/hdaudioctl.c	2021-06-21 03:09:52.000000000 +0000
+++ hdaudioctl/hdaudioctl.c	2025-09-23 06:38:29.323289473 +0000
@@ -305,7 +305,7 @@
 		jack = pin_jacks[(config >> 16) & 0xf];
 		loc = pin_locations[(config >> 24) & 0x3f];
 		color = pin_colors[(config >> 12) & 0xf];
-		printf("0x%2X %08X %2d %3d %-14s %-5s %-7s %-10s %-7s %4X\n",
+		printf("%4hd %08X %2d %3d %-14s %-5s %-7s %-10s %-7s %4X\n",
 		    nid, config, ((config >> 4U) & 0xf), (config & 0xf),
 		    device, conn, jack, loc, color, ((config >> 8U) & 0xf));
 	}
```

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.