Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drivers/ioexpander/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ int gpio_pin_register(FAR struct gpio_dev_s *dev, int minor)
int gpio_pin_register_byname(FAR struct gpio_dev_s *dev,
FAR const char *pinname)
{
char devname[32];
char devname[64];
int ret;

DEBUGASSERT(dev != NULL && dev->gp_ops != NULL && pinname != NULL);
Expand Down Expand Up @@ -691,7 +691,7 @@ int gpio_pin_unregister(FAR struct gpio_dev_s *dev, int minor)
int gpio_pin_unregister_byname(FAR struct gpio_dev_s *dev,
FAR const char *pinname)
{
char devname[32];
char devname[64];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see how this should help. Maybe snprintf(devname, sizeof(devname) - 5, "/dev/%s", pinname); instead or snprintf(devname, sizeof(devname) - sizeof("/dev/") - 1, "/dev/%s", pinname);?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, the problem is fixed here: #8658. Let's close this PR.


snprintf(devname, sizeof(devname), "/dev/%s", pinname);

Expand Down