diff options
Diffstat (limited to 'otherlibs/win32graph/open.c')
-rw-r--r-- | otherlibs/win32graph/open.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/otherlibs/win32graph/open.c b/otherlibs/win32graph/open.c index 4bdae36a1..4138fccde 100644 --- a/otherlibs/win32graph/open.c +++ b/otherlibs/win32graph/open.c @@ -48,7 +48,8 @@ HFONT CreationFont(char *name) CurrentFont.lfWeight = FW_NORMAL; CurrentFont.lfHeight = grwindow.CurrentFontSize; CurrentFont.lfPitchAndFamily = (BYTE) (FIXED_PITCH | FF_MODERN); - strcpy(CurrentFont.lfFaceName, name); /* Courier */ + strncpy(CurrentFont.lfFaceName, name, sizeof(CurrentFont.lfFaceName)); + CurrentFont.lfFaceName[sizeof(CurrentFont.lfFaceName) - 1] = 0; return (CreateFontIndirect(&CurrentFont)); } |