Fix a potential single byte overflow

This commit is contained in:
Lior Halphon 2020-09-17 23:47:35 +03:00
parent 2e4a638077
commit e35c22d405
1 changed files with 2 additions and 2 deletions

View File

@ -132,7 +132,7 @@ static const char *value_to_string(GB_gameboy_t *gb, uint16_t value, bool prefer
}
/* Avoid overflow */
if (symbol && strlen(symbol->name) > 240) {
if (symbol && strlen(symbol->name) >= 240) {
symbol = NULL;
}
@ -172,7 +172,7 @@ static const char *debugger_value_to_string(GB_gameboy_t *gb, value_t value, boo
}
/* Avoid overflow */
if (symbol && strlen(symbol->name) > 240) {
if (symbol && strlen(symbol->name) >= 240) {
symbol = NULL;
}