mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
man/example: fix build failure of hwdb-usb-device.c
STRLEN() and xsprintf() is our internal macros.
This commit is contained in:
parent
c099e8f21f
commit
06d0dcc009
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user