diff options
Diffstat (limited to 'plugins/Utils')
-rw-r--r-- | plugins/Utils/mir_fonts.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/Utils/mir_fonts.cpp b/plugins/Utils/mir_fonts.cpp index 237eb040f7..768ac12363 100644 --- a/plugins/Utils/mir_fonts.cpp +++ b/plugins/Utils/mir_fonts.cpp @@ -60,10 +60,11 @@ int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,cons int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr)
{
ColourIDT cid;
+
memset(&cid, 0, sizeof(cid));
- cid.cbSize=sizeof(cid);
- mir_tstrncpy(cid.group,pszSection,sizeof(cid.group)); /* buffer safe */
- mir_tstrncpy(cid.name,pszDescription,sizeof(cid.name)); /* buffer safe */
- *pclr=(COLORREF)CallService(MS_COLOUR_GETT,(WPARAM)&cid,0);
- return (int)*pclr==-1;
+ cid.cbSize = sizeof(cid);
+ _tcsncpy_s(cid.group, pszSection, _TRUNCATE);
+ _tcsncpy_s(cid.name, pszDescription, _TRUNCATE);
+ *pclr = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, 0);
+ return (int)*pclr == -1;
}
|