@@ -36,10 +36,11 @@ #ifdef OF_WINDOWS # include "OFWin32ConsoleStdIOStream.h" #endif #import "OFInitializationFailedException.h" +#import "OFInvalidArgumentException.h" #import "OFNotOpenException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" @@ -483,10 +484,13 @@ #endif } - (void)setCursorPosition: (of_point_t)position { + if (position.x < 0 || position.y < 0) + @throw [OFInvalidArgumentException exception]; + #if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) if (!isatty(_fd)) return; [self writeFormat: @"\033[%u;%uH",