diff --git a/reactos/win32ss/user/user32/windows/font.c b/reactos/win32ss/user/user32/windows/font.c index bcbd2424017..96b50d85b0c 100644 --- a/reactos/win32ss/user/user32/windows/font.c +++ b/reactos/win32ss/user/user32/windows/font.c @@ -218,9 +218,12 @@ GetTabbedTextExtentA( { LONG ret; UINT cp = GdiGetCodePage( hDC ); // CP_ACP - DWORD len = MultiByteToWideChar(cp, 0, lpString, nCount, NULL, 0); + DWORD len; + LPWSTR strW; + + len = MultiByteToWideChar(cp, 0, lpString, nCount, NULL, 0); if (!len) return 0; - LPWSTR strW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + strW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (!strW) return 0; MultiByteToWideChar(cp, 0, lpString, nCount, strW, len); ret = GetTabbedTextExtentW(hDC, strW, len, nTabPositions, lpnTabStopPositions);