diff --git a/lib/driver.c b/lib/driver.c index 4c10a49..ff4730f 100644 --- a/lib/driver.c +++ b/lib/driver.c @@ -247,9 +247,9 @@ const char *dev_id(const struct device_d *dev) { - static char buf[sizeof(unsigned long) * 2]; + static char buf[MAX_DRIVER_NAME + 16]; - sprintf(buf, FORMAT_DRIVER_MANE_ID, dev->name, dev->id); + snprintf(buf, sizeof(buf), FORMAT_DRIVER_MANE_ID, dev->name, dev->id); return buf; }