summaryrefslogtreecommitdiff
path: root/plugins/Utils/mir_fonts.cpp
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-13 08:01:55 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-13 08:01:55 +0000
commit303e6b483aff4126701ca375dd085e9ae1d18b43 (patch)
tree148d820728544a5fd6f6e87fdffbc5b80424c457 /plugins/Utils/mir_fonts.cpp
parentcce79a92d5341111997eaf7fd0a420fdddc3e50d (diff)
multiple buf size fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@11361 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Utils/mir_fonts.cpp')
-rw-r--r--plugins/Utils/mir_fonts.cpp11
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;
}