Skip to content

Commit

Permalink
BART_DEBUG_LEVEL: fix bug in strtol conversion
Browse files Browse the repository at this point in the history
Commit 848955c made it impossible to
disable debug output (for example, by preceding a command with
BART_DEBUG_LEVEL=0), since it ignored that value when returned from
strtol.
  • Loading branch information
hcmh committed Apr 5, 2024
1 parent cc3069a commit a24ed81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/misc/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void debug_vprintf(int level, const char* fmt, va_list ap)
errno = 0;
long r = strtol(str, NULL, 10);

if ((errno == 0) && (0 < r) && (r < 10))
if ((errno == 0) && (0 <= r) && (r < 10))
debug_level = r;

errno = 0;
Expand Down

0 comments on commit a24ed81

Please sign in to comment.