Zero the last character in lfFaceName when converting a LOGFONT from A to W or vice...
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 19 Dec 2008 00:12:43 +0000 (00:12 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 19 Dec 2008 00:12:43 +0000 (00:12 +0000)
DPRINT1 -> DPRINT

svn path=/trunk/; revision=38183

reactos/dll/win32/gdi32/objects/font.c
reactos/dll/win32/gdi32/objects/utils.c

index 9ed1850..3ae1ee5 100644 (file)
@@ -108,7 +108,7 @@ static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
     lenW = MultiByteToWideChar(cp, 0, str, count, NULL, 0);
     strW = HeapAlloc(GetProcessHeap(), 0, lenW*sizeof(WCHAR));
     MultiByteToWideChar(cp, 0, str, count, strW, lenW);
-    DPRINT1("mapped %s -> %S\n", str, strW);
+    DPRINT("mapped %s -> %S\n", str, strW);
     if(plenW) *plenW = lenW;
     if(pCP) *pCP = cp;
     return strW;
index 0d66080..fb99ed8 100644 (file)
@@ -329,6 +329,7 @@ LogFontA2W(LPLOGFONTW pW, CONST LOGFONTA *pA)
   COPYN(lfQuality);
   COPYN(lfPitchAndFamily);
   COPYS(lfFaceName,LF_FACESIZE);
+  pW->lfFaceName[LF_FACESIZE - 1] = '\0';
 
 #undef COPYN
 #undef COPYS
@@ -355,6 +356,7 @@ LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW)
   COPYN(lfQuality);
   COPYN(lfPitchAndFamily);
   COPYS(lfFaceName,LF_FACESIZE);
+  pA->lfFaceName[LF_FACESIZE - 1] = '\0';
 
 #undef COPYN
 #undef COPYS