summaryrefslogtreecommitdiff
path: root/ldmicro/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ldmicro/lib')
-rw-r--r--ldmicro/lib/linuxUI/linuxLD.h2
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/ldmicro/lib/linuxUI/linuxLD.h b/ldmicro/lib/linuxUI/linuxLD.h
index 28116b2..ce0b812 100644
--- a/ldmicro/lib/linuxUI/linuxLD.h
+++ b/ldmicro/lib/linuxUI/linuxLD.h
@@ -182,7 +182,7 @@ typedef struct FontTag {
int nOrientation;
int fnWeight;
DWORD fdwItalic;
- LPCTSTR lpszFace;
+ LPTSTR lpszFace;
} *HFONT, FONT;
typedef struct tagLOGBRUSH {
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;
}