diff options
Diffstat (limited to 'ldmicro/lib/linuxUI/linuxUI.cpp')
-rw-r--r-- | ldmicro/lib/linuxUI/linuxUI.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ldmicro/lib/linuxUI/linuxUI.cpp b/ldmicro/lib/linuxUI/linuxUI.cpp index 0d08de5..ba5eb95 100644 --- a/ldmicro/lib/linuxUI/linuxUI.cpp +++ b/ldmicro/lib/linuxUI/linuxUI.cpp @@ -316,14 +316,15 @@ HBRUSH CreateBrushIndirect(PLOGBRUSH plb) HFONT CreateFont(int nHeight, int nWidth, int nOrientation, int fnWeight, DWORD fdwItalic, LPCTSTR lpszFace) { - HFONT font = new FONT; + HFONT font = (HFONT)malloc(strlen(lpszFace) + 1 + sizeof(FONT)); font->nHeight = nHeight; font->nWidth = nWidth; font->nOrientation = nOrientation; font->fnWeight = fnWeight; font->fdwItalic = fdwItalic; - font->lpszFace = lpszFace; - + font->lpszFace = (char*)malloc(strlen(lpszFace)+1); + strcpy(font->lpszFace, lpszFace); + return font; } |