aboutsummaryrefslogtreecommitdiff
path: root/src/lexer.c
diff options
context:
space:
mode:
authorc2024-01-28 21:43:37 -0500
committerc2024-01-28 21:43:37 -0500
commitca20ff4f4d0ac63856e538f9f4cef97197bf6465 (patch)
treeba8886c8832e082332a284e3b18fb0e4bbce3d05 /src/lexer.c
parent422606d8b3cc6fba74f97af46f0378fc274d60ad (diff)
Fixed buffer-overflow.
Diffstat (limited to 'src/lexer.c')
-rw-r--r--src/lexer.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lexer.c b/src/lexer.c
index a89c9ad..a93828a 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -26,8 +26,6 @@ void lexer_destroy(lexer_t* lexer) {
}
void lexer_add_token(lexer_t* lexer, token_t* token) {
- token_t* t;
-
if (lexer->tokenl) {
lexer->tokenl_last->nxt = token;
lexer->tokenl_last = token;
@@ -47,7 +45,7 @@ void lexer_add_current_char(lexer_t* lexer, int type) {
lexer_add_token(lexer, t);
}
-void lexer_add_current_char_to_last_token(lexer_t* lexer, int type) {
+void lexer_add_current_char_to_last_token(lexer_t* lexer, token_type_t type) {
if (lexer->tokenl_last && lexer->tokenl_last->type == type) {
token_add_char(lexer->tokenl_last, *lexer->src);
} else {