From 86f1a98ac846d82e09918f2a7f843160eaaad886 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 24 Sep 2008 23:25:24 +0000 Subject: (svn r14397) -Fix: possible buffer overrun, wrong parameter type passed to printf and && where || is meant. Found by MSVC's code analysis (Darkvater) --- src/video/win32_v.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/video') diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index 2bbb96c63..9016c93e8 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -289,7 +289,7 @@ static bool MakeWindow(bool full_screen) } else { TCHAR Windowtitle[50]; - _sntprintf(Windowtitle, sizeof(Windowtitle), _T("OpenTTD %s"), MB_TO_WIDE(_openttd_revision)); + _sntprintf(Windowtitle, lengthof(Windowtitle), _T("OpenTTD %s"), MB_TO_WIDE(_openttd_revision)); _wnd.main_wnd = CreateWindow(_T("OTTD"), Windowtitle, style, x, y, w, h, 0, 0, GetModuleHandle(NULL), 0); if (_wnd.main_wnd == NULL) usererror("CreateWindow failed"); -- cgit v1.2.3-54-g00ecf