NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/59667: hdaudioctl(8): nid format differs between `show' and `get' commands.



>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));
 	}
```



Home | Main Index | Thread Index | Old Index