From: cuz Date: Sun, 6 Oct 2002 20:58:22 +0000 (+0000) Subject: Output an error if an invalid address is used X-Git-Tag: V2.12.0~2180 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9ca21c07e080057c3c3c9f45e626c06bd81ebd87;p=cc65 Output an error if an invalid address is used git-svn-id: svn://svn.cc65.org/cc65/trunk@1452 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/dbg/dbg.c b/libsrc/dbg/dbg.c index 2c26277e0..84135ab57 100644 --- a/libsrc/dbg/dbg.c +++ b/libsrc/dbg/dbg.c @@ -522,8 +522,8 @@ static char Input (char* Prompt, char* Buf, unsigned char Count) -static int InputHex (char* Prompt, unsigned* Val) -/* Prompt for a hexadecimal value */ +static char InputHex (char* Prompt, unsigned* Val) +/* Prompt for a hexadecimal value. Return 0 on failure. */ { char Buf [5]; char* P; @@ -563,14 +563,6 @@ static int InputHex (char* Prompt, unsigned* Val) -static int InputGoto (unsigned* Addr) -/* Prompt "Goto" and read an address */ -{ - return InputHex ("Goto: ", Addr); -} - - - static void ErrorPrompt (char* Msg) /* Display an error message and wait for a key */ { @@ -589,6 +581,19 @@ static void ErrorPrompt (char* Msg) +static char InputGoto (unsigned* Addr) +/* Prompt "Goto" and read an address. Print an error and return 0 on failure. */ +{ + char Ok; + Ok = InputHex ("Goto: ", Addr); + if (!Ok) { + ErrorPrompt ("Invalid input - press a key"); + } + return Ok; +} + + + static void BreakInRomError (void) /* Print an error message if we cannot set a breakpoint */ {