summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-07 09:11:11 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-07 09:11:11 +0000
commitba13e8d6612aaddebe640d0538f9bb859b600ba2 (patch)
tree13998240d04ca8013287d4708cf0993cb6672a42 /src
parentfe1cc2f25ac9ddaad8213e6f34268f1329c3d865 (diff)
downloadhercules-ba13e8d6612aaddebe640d0538f9bb859b600ba2.tar.gz
hercules-ba13e8d6612aaddebe640d0538f9bb859b600ba2.tar.bz2
hercules-ba13e8d6612aaddebe640d0538f9bb859b600ba2.tar.xz
hercules-ba13e8d6612aaddebe640d0538f9bb859b600ba2.zip
Fixed showmsg causing silent access violation exceptions on Windows (WinAPI function used does not accept NULL)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10176 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/common/showmsg.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index dd8cfb07a..58c26ac8a 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -350,6 +350,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
// \033[2J - Clears the screen and moves the cursor to the home position (line 1, column 1).
uint8 num = (numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F);
int cnt;
+ uint32 tmp;
COORD origin = {0,0};
if(num==1)
{ // chars from start up to and including cursor
@@ -365,8 +366,8 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
origin = info.dwCursorPosition;
cnt = info.dwSize.X * (info.dwSize.Y - info.dwCursorPosition.Y) - info.dwCursorPosition.X;
}
- FillConsoleOutputAttribute(handle,info.wAttributes,cnt,origin,NULL);
- FillConsoleOutputCharacter(handle,' ', cnt,origin,NULL);
+ FillConsoleOutputAttribute(handle, info.wAttributes, cnt, origin, &tmp);
+ FillConsoleOutputCharacter(handle, ' ', cnt, origin, &tmp);
}
else if( *q=='K' )
{ // \033[K : clear line from actual position to end of the line
@@ -377,6 +378,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
uint8 num = (numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F);
COORD origin = {0,info.dwCursorPosition.Y};
SHORT cnt;
+ uint32 tmp;
if(num==1)
{
cnt = info.dwCursorPosition.X + 1;
@@ -390,8 +392,8 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr)
origin = info.dwCursorPosition;
cnt = info.dwSize.X - info.dwCursorPosition.X; // how many spaces until line is full
}
- FillConsoleOutputAttribute(handle, info.wAttributes, cnt, origin, NULL);
- FillConsoleOutputCharacter(handle, ' ', cnt, origin, NULL);
+ FillConsoleOutputAttribute(handle, info.wAttributes, cnt, origin, &tmp);
+ FillConsoleOutputCharacter(handle, ' ', cnt, origin, &tmp);
}
else if( *q == 'H' || *q == 'f' )
{ // \033[#;#H - Cursor Position (CUP)