diff options
author | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-08-20 19:13:16 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-08-20 19:29:30 +0200 |
commit | e4193309c4d5743499a9ed2361918447e02e094e (patch) | |
tree | 52b3f5a9083af10c02ff051d0c4751ed82caa5c4 /man/hwdb-usb-device.c | |
parent | Merge pull request #20488 from yuwata/timesync-fix (diff) | |
download | systemd-e4193309c4d5743499a9ed2361918447e02e094e.tar.xz systemd-e4193309c4d5743499a9ed2361918447e02e094e.zip |
hwdb-usb-device: use xsprintf
Diffstat (limited to 'man/hwdb-usb-device.c')
-rw-r--r-- | man/hwdb-usb-device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/man/hwdb-usb-device.c b/man/hwdb-usb-device.c index 8a4b86e7bd..a85c3bcf10 100644 --- 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) |