chiark / gitweb /
Replace a TCHAR with a WCHAR.
authorSimon Tatham <anakin@pobox.com>
Sat, 1 Aug 2015 10:14:30 +0000 (11:14 +0100)
committerSimon Tatham <anakin@pobox.com>
Sat, 1 Aug 2015 10:14:30 +0000 (11:14 +0100)
MultiByteToWideChar expects a WCHAR[256] output buffer if you pass it
an output length of 256. TCHAR[256] is entirely the wrong size, though
for some reason Visual Studio seems not to have thrown a compile error
pointing that out.

Thanks to Jason Hood for spotting this.

windows.c

index fde1e6b5c02517affdd89a783f86e22d9a00f209..ba657c0d33ad2089aed6604b77086a29cd4544df 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -608,7 +608,7 @@ static void win_draw_text(void *handle, int x, int y, int fonttype,
        HFONT oldfont;
        TEXTMETRIC tm;
        SIZE size;
-       TCHAR wText[256];
+       WCHAR wText[256];
        MultiByteToWideChar (CP_UTF8, 0, text, -1, wText, 256);
 
        oldfont = SelectObject(fe->hdc, fe->fonts[i].font);