mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
fix: Integer underflow in lexer error message formatting
This commit is contained in:
@@ -203,7 +203,7 @@ impl Source {
|
||||
|
||||
let line_str = format!("{line}");
|
||||
let line_num_width = line_str.len() + 1;
|
||||
let col_spaces = col as usize - 1;
|
||||
let col_spaces = (col as usize).saturating_sub(1);
|
||||
|
||||
format!(
|
||||
"\n--> {}:{}:{}\n{:<line_num_width$}|\n\
|
||||
|
||||
Reference in New Issue
Block a user