From 303e6b483aff4126701ca375dd085e9ae1d18b43 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Sat, 13 Dec 2014 08:01:55 +0000 Subject: multiple buf size fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@11361 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AutoShutdown/src/utils.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'plugins/AutoShutdown/src') 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 ***********************************/ -- cgit v1.2.3