- Commit
- ce6ec7916e6e96f67ac404a1590c1d75e70aee1d
- Parent
- 676d924a11ab98749b605a10400056512b739b92
- Author
- Pablo <pablo-pie@riseup.net>
- Date
Fixed a bug
Nasty segfault hiding in the dark
Simple interface to set PulseAudio's volume, with graphical feedback! 🔊
Fixed a bug
Nasty segfault hiding in the dark
1 files changed, 7 insertions, 6 deletions
| Status | Name | Changes | Insertions | Deletions |
| Modified | src/configure.c | 2 files changed | 7 | 6 |
diff --git a/src/configure.c b/src/configure.c @@ -401,6 +401,11 @@ b8 parse_int(SV text, Location loc, i64* val) return true; } +b8 lexer_finished(Lexer* l) +{ + return l->cursor >= l->count; +} + void lexer_skip_whitespace(Lexer* l) { for (; l->cursor < l->count; l->cursor++) { @@ -408,9 +413,10 @@ void lexer_skip_whitespace(Lexer* l) if (c == ';' || c == '#') { // comment for (; l->cursor < l->count && l->data[l->cursor] != '\n'; l->cursor++); - if (l->cursor >= l->count) return; l->cursor++; + if (lexer_finished(l)) return; + l->current_line++; l->current_line_start = l->cursor; c = l->data[l->cursor]; @@ -466,11 +472,6 @@ b8 lexer_new(const char* path, Lexer* l, Arena* str_store) return true; } -b8 lexer_finished(Lexer* l) -{ - return l->cursor >= l->count; -} - const char* escape_char(char c) { static char str[2] = {0};