1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-06 16:29:03 +00:00

Fix crashing bug in Goto

The application would crash if an invalid file offset was entered
(with "+xxxx").  This bug has been present since v1.0.
This commit is contained in:
Andy McFadden 2020-01-24 15:25:01 -08:00
parent d4b97007df
commit 6ff349c2f6

View File

@ -136,7 +136,10 @@ namespace SourceGen.WpfGui {
if (input[0] == '+') {
// this can only be an offset; convert as hexadecimal number
try {
TargetOffset = Convert.ToInt32(input.Substring(1), 16);
int offset = Convert.ToInt32(input.Substring(1), 16);
if (offset >= 0 && offset < mProject.FileDataLength) {
TargetOffset = offset;
}
} catch (Exception) {
}
return;