This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 4231938892 rtc: Fix compiler warning in driver initialization.
4231938892 is described below
commit 42319388921afc033ea0798790f27c154c9698e3
Author: Fotis Panagiotopoulos <[email protected]>
AuthorDate: Thu May 11 13:44:42 2023 +0300
rtc: Fix compiler warning in driver initialization.
---
drivers/timers/rtc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/timers/rtc.c b/drivers/timers/rtc.c
index e375cfa64f..7614000258 100644
--- a/drivers/timers/rtc.c
+++ b/drivers/timers/rtc.c
@@ -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 */