summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/src
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/AutoShutdown/src
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/AutoShutdown/src')
-rw-r--r--plugins/AutoShutdown/src/utils.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp
index 7eeab7d78f..4335dd7566 100644
--- a/plugins/AutoShutdown/src/utils.cpp
+++ b/plugins/AutoShutdown/src/utils.cpp
@@ -260,12 +260,13 @@ 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;
}
/************************* Skin ***********************************/