Skip to content

Commit

Permalink
Fix an arithmetic overflow crash in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ileonte committed May 2, 2024
1 parent 9dab567 commit 712c29d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/config_parser.jai
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ parse_key_combo :: (using parser: *Config_Parser, combo_str: string, line: strin

if (key_code >= #char "a") && (key_code <= #char "z") {
// Uppercase it, since our keyboard codes are uppercase.
key_code += cast,trunc(u32) (#char "A" - #char "a"); // This is a negative number; but we cast it to u32 and get the same result, because, twos-complement. The trunc is to make this legal.
key_code += (#char "a" - #char "A");
}

if s.count > 0 {
Expand Down

0 comments on commit 712c29d

Please sign in to comment.