diff options
author | c | 2024-01-28 21:43:37 -0500 |
---|---|---|
committer | c | 2024-01-28 21:43:37 -0500 |
commit | ca20ff4f4d0ac63856e538f9f4cef97197bf6465 (patch) | |
tree | ba8886c8832e082332a284e3b18fb0e4bbce3d05 /src/include | |
parent | 422606d8b3cc6fba74f97af46f0378fc274d60ad (diff) |
Fixed buffer-overflow.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/lexer.h | 2 | ||||
-rw-r--r-- | src/include/util.h | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/include/lexer.h b/src/include/lexer.h index 5235f3b..79a3cb6 100644 --- a/src/include/lexer.h +++ b/src/include/lexer.h @@ -53,7 +53,7 @@ void lexer_add_current_char(lexer_t* lexer, int type); Add first character of given lexer's `src` to the value of the last token in `tokenl`, if it exists. Otherwise, create new token and add it. */ -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); /* Handle regular state. */ void lexer_do_reg(lexer_t* lexer); diff --git a/src/include/util.h b/src/include/util.h index 839d3e4..9f8a2b0 100644 --- a/src/include/util.h +++ b/src/include/util.h @@ -6,6 +6,13 @@ #include <string.h> #include <stdio.h> +#define MIN(a, b) (a < b ? a : b) +#define MAX(a, b) (a > b ? a : b) + +/* + TODO: Make these macros, to allow for better logging (printing __FILE__, + __func__, etc.) +*/ /* Log some debug information. */ void log_dbg(const char*, ...); /* c: */ |