grlib: Fix snprintf() overflow warnings from gcc 12

Updates #4662.
This commit is contained in:
Joel Sherrill
2023-01-27 17:44:59 -06:00
parent 453939753b
commit 29a3ad1ba9
14 changed files with 15 additions and 15 deletions

View File

@@ -379,12 +379,12 @@ static int grgpio_gpiolib_get_info(void *handle, struct gpiolib_info *pinfo)
/* Failed to get prefix, make sure of a unique FS name
* by using the driver minor.
*/
snprintf(pinfo->devName, 64, "/dev/grgpio%d/%d", dev->minor_drv, portnr);
snprintf(pinfo->devName, 80, "/dev/grgpio%d/%d", dev->minor_drv, portnr);
} else {
/* Got special prefix, this means we have a bus prefix
* And we should use our "bus minor"
*/
snprintf(pinfo->devName, 64, "/dev/%sgrgpio%d/%d", prefix, dev->minor_bus, portnr);
snprintf(pinfo->devName, 80, "/dev/%sgrgpio%d/%d", prefix, dev->minor_bus, portnr);
}
return 0;