summaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-04-02 19:21:19 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-04-03 10:44:41 +0200
commit06d0dcc009f6d8b16d02f65fc20f7e1d76c77721 (patch)
tree4a5cd3d8aa4b4e4865294c668268570c24e8559a /man
parentMerge pull request #32060 from YHNdnzj/timespec-minor-cleanup (diff)
downloadsystemd-06d0dcc009f6d8b16d02f65fc20f7e1d76c77721.tar.xz
systemd-06d0dcc009f6d8b16d02f65fc20f7e1d76c77721.zip
man/example: fix build failure of hwdb-usb-device.c
STRLEN() and xsprintf() is our internal macros.
Diffstat (limited to 'man')
-rw-r--r--man/hwdb-usb-device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/man/hwdb-usb-device.c b/man/hwdb-usb-device.c
index 19a5db8022..3ac012070e 100644
--- 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)