projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c099e8f
)
man/example: fix build failure of hwdb-usb-device.c
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Tue, 2 Apr 2024 17:21:19 +0000
(
02:21
+0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Wed, 3 Apr 2024 08:44:41 +0000
(17:44 +0900)
STRLEN() and xsprintf() is our internal macros.
man/hwdb-usb-device.c
patch
|
blob
|
history
diff --git
a/man/hwdb-usb-device.c
b/man/hwdb-usb-device.c
index 19a5db802299a552fc6cf22a94bb04408220c295..3ac012070ebf6992728332901dff55d84309d46c 100644
(file)
--- a/
man/hwdb-usb-device.c
+++ b/
man/hwdb-usb-device.c
@@
-5,13
+5,13
@@
#include <sd-hwdb.h>
int print_usb_properties(uint16_t vid, uint16_t pid) {
- char match[
STRLEN("usb:vp") + DECIMAL_STR_MAX(uint16_t) * 2
];
+ char match[
128
];
sd_hwdb *hwdb;
const char *key, *value;
int r;
/* Match this USB vendor and product ID combination */
-
xsprintf(
match, "usb:v%04Xp%04X", vid, pid);
+
snprintf(match, sizeof
match, "usb:v%04Xp%04X", vid, pid);
r = sd_hwdb_new(&hwdb);
if (r < 0)