From: Luca Boccassi Date: Fri, 20 Aug 2021 17:13:16 +0000 (+0100) Subject: hwdb-usb-device: use xsprintf X-Git-Tag: v250-rc1~791^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4193309c4d5743499a9ed2361918447e02e094e;p=thirdparty%2Fsystemd.git hwdb-usb-device: use xsprintf --- diff --git a/man/hwdb-usb-device.c b/man/hwdb-usb-device.c index 8a4b86e7bd1..a85c3bcf103 100644 --- a/man/hwdb-usb-device.c +++ b/man/hwdb-usb-device.c @@ -3,13 +3,13 @@ #include 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)