This is an automated email from the ASF dual-hosted git repository.
davids5 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 a2190aeb35 Fix error: '%s' directive output may be truncated
a2190aeb35 is described below
commit a2190aeb35f00db5a925a26fb1e2d3977706ecb1
Author: Xiang Xiao <[email protected]>
AuthorDate: Sat Feb 25 18:57:19 2023 +0800
Fix error: '%s' directive output may be truncated
writing up to 31 bytes into a region of size 27 [-Werror=format-truncation=]
Signed-off-by: Xiang Xiao <[email protected]>
---
drivers/ioexpander/gpio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ioexpander/gpio.c b/drivers/ioexpander/gpio.c
index a78ae99058..e5c1f1948a 100644
--- a/drivers/ioexpander/gpio.c
+++ b/drivers/ioexpander/gpio.c
@@ -563,7 +563,7 @@ static int gpio_ioctl(FAR struct file *filep, int cmd,
unsigned long arg)
int gpio_pin_register(FAR struct gpio_dev_s *dev, int minor)
{
- char devname[32];
+ char devname[16];
snprintf(devname, sizeof(devname), "gpio%u", (unsigned int)minor);
return gpio_pin_register_byname(dev, devname);
@@ -663,7 +663,7 @@ int gpio_pin_register_byname(FAR struct gpio_dev_s *dev,
int gpio_pin_unregister(FAR struct gpio_dev_s *dev, int minor)
{
- char devname[32];
+ char devname[16];
snprintf(devname, sizeof(devname), "gpio%u", (unsigned int)minor);
return gpio_pin_unregister_byname(dev, devname);
}