Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GCC warnings #84

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix GCC buffer overflow warning
  • Loading branch information
lupyuen committed Dec 27, 2020
commit e529d495cfc24d02c66006f58869723346b90c10
2 changes: 1 addition & 1 deletion components/hal_drv/bl602_hal/hal_button.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void fdt_button_module_init(const void *fdt, int button_offset)

for (i = 0; i < GPIO_MODULE_MAX; i++) {
memset(gpio_node, 0, sizeof(gpio_node));
sprintf(gpio_node, "gpio%d", i);
snprintf(gpio_node, sizeof(gpio_node), "gpio%d", i);
offset1 = fdt_subnode_offset(fdt, button_offset, gpio_node);
if (0 > offset1) {
//log_warn("gpio[%d] %s NULL. \r\n", i, gpio_node);
Expand Down