rtc: Fix compiler warning in driver initialization.

This commit is contained in:
Fotis Panagiotopoulos 2023-05-11 13:44:42 +03:00 committed by Petro Karashchenko
parent e8e50900d0
commit 4231938892

View File

@ -819,7 +819,7 @@ static int rtc_unlink(FAR struct inode *inode)
int rtc_initialize(int minor, FAR struct rtc_lowerhalf_s *lower)
{
FAR struct rtc_upperhalf_s *upper;
char devpath[16];
char devpath[20];
int ret;
DEBUGASSERT(lower && lower->ops && minor >= 0 && minor < 1000);
@ -844,11 +844,11 @@ int rtc_initialize(int minor, FAR struct rtc_lowerhalf_s *lower)
upper->unlinked = false; /* Driver is not unlinked */
#endif
/* Create the driver name. There is space for the a minor number up to 6
/* Create the driver name. There is space for the a minor number up to 10
* characters
*/
snprintf(devpath, 16, "/dev/rtc%d", minor);
snprintf(devpath, sizeof(devpath), "/dev/rtc%d", minor);
/* And, finally, register the new RTC driver */