mirror of
https://github.com/vsergeev/c-periphery.git
synced 2026-09-22 04:33:43 +08:00
gpio: make value string array static in write for sysfs implementation
This commit is contained in:
+1
-1
@@ -298,7 +298,7 @@ static int gpio_sysfs_read(gpio_t *gpio, bool *value) {
|
||||
}
|
||||
|
||||
static int gpio_sysfs_write(gpio_t *gpio, bool value) {
|
||||
char value_str[][2] = {"0\n", "1\n"};
|
||||
static const char *value_str[2] = {"0\n", "1\n"};
|
||||
|
||||
/* Write fd */
|
||||
if (write(gpio->u.sysfs.line_fd, value_str[value], 2) < 0)
|
||||
|
||||
Reference in New Issue
Block a user