diff --git a/src/commands.mm b/src/commands.mm index bdd1bbb..d4a1e27 100644 --- a/src/commands.mm +++ b/src/commands.mm @@ -236,7 +236,7 @@ execute( @try { val = (int)[c longLongValueWithBase:0]; } @catch (OFInvalidFormatException *e) { - conoutf(@"unknown command: %s", c); + conoutf(@"unknown command: %@", c); } } else { if ([identifier diff --git a/src/console.mm b/src/console.mm index 2a95cfa..bedb218 100644 --- a/src/console.mm +++ b/src/console.mm @@ -191,14 +191,15 @@ keypress(int code, bool isdown, int cooked) break; case SDLK_BACKSPACE: - case SDLK_LEFT: { - [commandbuf - deleteCharactersInRange: - OFMakeRange(commandbuf.length - 1, 1)]; + case SDLK_LEFT: + if (commandbuf.length > 0) + [commandbuf + deleteCharactersInRange: + OFMakeRange( + commandbuf.length - 1, 1)]; resetcomplete(); break; - } case SDLK_UP: if (histpos)