From 67b6d9ed60cf6e3f5da16c653e14a4bcd7cb6198 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 18 Jun 2025 15:50:46 +0200 Subject: [PATCH] apix-gpio-example: fix invalid NULL check for controller names Replace incorrect NULL pointer checks on button_ctrl and led_ctrl with string emptiness checks, since these are fixed-size character arrays and never NULL. Signed-off-by: Javier Viguera --- apix-gpio-example/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apix-gpio-example/main.c b/apix-gpio-example/main.c index f707950..b7751e9 100644 --- a/apix-gpio-example/main.c +++ b/apix-gpio-example/main.c @@ -163,8 +163,8 @@ int main(int argc, char *argv[]) usage_and_exit(name, EXIT_FAILURE); } - if (button_ctrl == NULL || button_line < 0 || - led_ctrl == NULL || led_line < 0) { + if (button_ctrl[0] == '\0' || button_line < 0 || + led_ctrl[0] == '\0' || led_line < 0) { printf("Unable to parse button and led GPIOs\n"); return EXIT_FAILURE; }