mirror of
https://github.com/emersion/kanshi
synced 2024-11-26 05:55:27 +01:00
parser: use abort() instead of assert(0).
assert(0) has no effect on NDEBUG builds, and means the program will continue running in an unexpected state.
This commit is contained in:
parent
f88ba3a1dd
commit
dabd7a2917
5
parser.c
5
parser.c
@ -1,5 +1,4 @@
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
@ -24,7 +23,7 @@ static const char *token_type_str(enum kanshi_token_type t) {
|
||||
case KANSHI_TOKEN_NEWLINE:
|
||||
return "newline";
|
||||
}
|
||||
assert(0);
|
||||
abort();
|
||||
}
|
||||
|
||||
static int parser_read_char(struct kanshi_parser *parser) {
|
||||
@ -333,7 +332,7 @@ static struct kanshi_profile_output *parse_profile_output(
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
abort();
|
||||
}
|
||||
has_key = false;
|
||||
output->fields |= key;
|
||||
|
Loading…
Reference in New Issue
Block a user