From 123ff301ea38a73673be06f6d0a6447656a45960 Mon Sep 17 00:00:00 2001 From: scovl Date: Fri, 20 Mar 2026 18:01:18 -0300 Subject: [PATCH] fix: replace inverted EXIT_SUCCESS/EXIT_FAILURE with correct 0/1 returns in process_line() process_line() was using EXIT_SUCCESS (0) to signal errors and EXIT_FAILURE (1) to signal success. While the numeric logic happened to work with the caller's !process_line() check, the macro semantics were inverted, creating a maintenance trap for future developers. Replace with plain 0 (failure) and 1 (success) literals to match the intended boolean semantics. --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index f6ada2f..71ffdba 100644 --- a/src/main.c +++ b/src/main.c @@ -67,7 +67,7 @@ int process_line(char* line, int line_number) { if (!delimiter) { fprintf(stderr, "Warning: Line %d is not in 'key=value' format.\n", line_number); - return EXIT_SUCCESS; + return 0; } *delimiter = '\0'; @@ -77,9 +77,9 @@ int process_line(char* line, int line_number) { if (value && !validate_option(key, value)) { printf("Error on line %d: '%s' is not a valid value for '%s'\n", line_number, value, key); - return EXIT_SUCCESS; + return 0; } - return EXIT_FAILURE; + return 1; }