summaryrefslogtreecommitdiff
path: root/src/common/showmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/showmsg.c')
-rw-r--r--src/common/showmsg.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index 58c26ac8a..c61530204 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -27,7 +27,6 @@
#endif
#else
#include <unistd.h>
- #include <ctype.h>
#ifdef DEBUGLOGMAP
#define DEBUGLOGPATH "log/map-server.log"
@@ -400,8 +399,8 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
// \033[#;#f - Horizontal & Vertical Position
// The first # specifies the line number, the second # specifies the column.
// The default for both is 1
- info.dwCursorPosition.X = (numbers[numpoint])?(numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F-1):0;
- info.dwCursorPosition.Y = (numpoint && numbers[numpoint-1])?(numbers[numpoint-1]>>4)*10+(numbers[numpoint-1]&0x0F-1):0;
+ info.dwCursorPosition.X = (numbers[numpoint])?(numbers[numpoint]>>4)*10+((numbers[numpoint]&0x0F)-1):0;
+ info.dwCursorPosition.Y = (numpoint && numbers[numpoint-1])?(numbers[numpoint-1]>>4)*10+((numbers[numpoint-1]&0x0F)-1):0;
if( info.dwCursorPosition.X >= info.dwSize.X ) info.dwCursorPosition.Y = info.dwSize.X-1;
if( info.dwCursorPosition.Y >= info.dwSize.Y ) info.dwCursorPosition.Y = info.dwSize.Y-1;
@@ -480,7 +479,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
else if( *q == 'G' )
{ // \033[#G - Cursor Horizontal Absolute (CHA)
// Moves the cursor to indicated column in current row.
- info.dwCursorPosition.X = (numbers[numpoint])?(numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F-1):0;
+ info.dwCursorPosition.X = (numbers[numpoint])?(numbers[numpoint]>>4)*10+((numbers[numpoint]&0x0F)-1):0;
if( info.dwCursorPosition.X >= info.dwSize.X )
info.dwCursorPosition.X = info.dwSize.X-1;