summaryrefslogtreecommitdiff
path: root/src/win32.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-09-24 23:25:24 +0000
committerrubidium <rubidium@openttd.org>2008-09-24 23:25:24 +0000
commit86f1a98ac846d82e09918f2a7f843160eaaad886 (patch)
tree55ef97f884a427b5807de2b489c5f2659cf4caa0 /src/win32.cpp
parentb907ffec97d4080935ce975b42d9f8475f7c5509 (diff)
downloadopenttd-86f1a98ac846d82e09918f2a7f843160eaaad886.tar.xz
(svn r14397) -Fix: possible buffer overrun, wrong parameter type passed to printf and && where || is meant. Found by MSVC's code analysis (Darkvater)
Diffstat (limited to 'src/win32.cpp')
-rw-r--r--src/win32.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/win32.cpp b/src/win32.cpp
index 9ee8c3000..acdaab87d 100644
--- a/src/win32.cpp
+++ b/src/win32.cpp
@@ -530,7 +530,7 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
ep->ContextRecord->EFlags
);
#else
- output += sprintf(output, "Exception %.8X at %.8X\r\n"
+ output += sprintf(output, "Exception %.8X at %.8p\r\n"
"Registers:\r\n"
" EAX: %.8X EBX: %.8X ECX: %.8X EDX: %.8X\r\n"
" ESI: %.8X EDI: %.8X EBP: %.8X ESP: %.8X\r\n"
@@ -596,9 +596,9 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
output = PrintModuleList(output);
{
- OSVERSIONINFO os;
+ _OSVERSIONINFOA os;
os.dwOSVersionInfoSize = sizeof(os);
- GetVersionEx(&os);
+ GetVersionExA(&os);
output += sprintf(output, "\r\nSystem information:\r\n"
" Windows version %d.%d %d %s\r\n\r\n",
os.dwMajorVersion, os.dwMinorVersion, os.dwBuildNumber, os.szCSDVersion);
@@ -804,7 +804,7 @@ void FiosGetDrives()
TCHAR drives[256];
const TCHAR *s;
- GetLogicalDriveStrings(sizeof(drives), drives);
+ GetLogicalDriveStrings(lengthof(drives), drives);
for (s = drives; *s != '\0';) {
FiosItem *fios = _fios_items.Append();
fios->type = FIOS_TYPE_DRIVE;