projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72fba0c
)
hwdb-usb-device: use xsprintf
author
Luca Boccassi
<luca.boccassi@microsoft.com>
Fri, 20 Aug 2021 17:13:16 +0000
(18:13 +0100)
committer
Luca Boccassi
<luca.boccassi@microsoft.com>
Fri, 20 Aug 2021 17:29:30 +0000
(18:29 +0100)
man/hwdb-usb-device.c
patch
|
blob
|
history
diff --git
a/man/hwdb-usb-device.c
b/man/hwdb-usb-device.c
index 8a4b86e7bd12823c3082fd9bc26c9c8e74949fbe..a85c3bcf103886696aa6ffe0667dbf96ff4171f8 100644
(file)
--- a/
man/hwdb-usb-device.c
+++ b/
man/hwdb-usb-device.c
@@
-3,13
+3,13
@@
#include <sd-hwdb.h>
int print_usb_properties(uint16_t vid, uint16_t pid) {
- char match[
15
];
+ char match[
STRLEN("usb:vp") + DECIMAL_STR_MAX(uint16_t) * 2
];
sd_hwdb *hwdb;
const char *key, *value;
int r;
/* Match this USB vendor and product ID combination */
-
snprintf(match, sizeof
match, "usb:v%04Xp%04X", vid, pid);
+
xsprintf(
match, "usb:v%04Xp%04X", vid, pid);
r = sd_hwdb_new(&hwdb);
if (r < 0)