Fix a potential single byte overflow
@@ -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;
}
