From 688f55ba998c19304a29727c910504903f4cc49a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Nov 2014 18:51:36 +0000 Subject: lstr* replacements git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AutoShutdown/src/frame.cpp | 2 +- plugins/AutoShutdown/src/shutdownsvc.cpp | 2 +- plugins/AutoShutdown/src/utils.cpp | 34 ++++++++++++++++---------------- plugins/AutoShutdown/src/watcher.cpp | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'plugins/AutoShutdown/src') diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index e406e4a494..b77aba262b 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -455,7 +455,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA if (hdc != NULL) { if (dat->hFont != NULL) hFontPrev = (HFONT)SelectObject(hdc,dat->hFont); - if (GetTextExtentPoint32(hdc,szOutput,lstrlen(szOutput),&size)) + if (GetTextExtentPoint32(hdc,szOutput,mir_tstrlen(szOutput),&size)) if (size.cx>=(rc.right-rc.left)) dat->flags&=FWPDF_TIMEISCLIPPED; if (dat->hFont != NULL) diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index 1ede40e86d..7f1ab8b818 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -483,7 +483,7 @@ INT_PTR ServiceGetTypeDescription(WPARAM wParam,LPARAM lParam) static char szConvBuf[128]; char *buf=u2a(pszDesc); if (buf==NULL) return 0; - lstrcpynA(szConvBuf,buf,sizeof(szConvBuf)); + mir_strncpy(szConvBuf,buf,sizeof(szConvBuf)); mir_free(buf); return (INT_PTR)szConvBuf; } diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp index 75c65dc345..5c537fa06c 100644 --- a/plugins/AutoShutdown/src/utils.cpp +++ b/plugins/AutoShutdown/src/utils.cpp @@ -51,14 +51,14 @@ void TrimString(TCHAR *pszStr) TCHAR *psz,szChars[]=_T(" \r\n\t"); for(i=0;ilfUnderline) fid.deffontsettings.style|=DBFONTF_UNDERLINE; if (plfDefault->lfStrikeOut) fid.deffontsettings.style|=DBFONTF_STRIKEOUT; fid.deffontsettings.charset=plfDefault->lfCharSet; - lstrcpyn(fid.deffontsettings.szFace,plfDefault->lfFaceName,SIZEOF(fid.deffontsettings.szFace)); /* buffer safe */ + mir_tstrncpy(fid.deffontsettings.szFace,plfDefault->lfFaceName,SIZEOF(fid.deffontsettings.szFace)); /* buffer safe */ } FontRegisterT(&fid); return 0; @@ -237,8 +237,8 @@ int FontService_GetFont(const TCHAR *pszSection,const TCHAR *pszDescription,COLO { FontIDT fid; fid.cbSize=sizeof(fid); - lstrcpyn(fid.group,pszSection,SIZEOF(fid.group)); /* buffer sfae */ - lstrcpyn(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */ + mir_tstrncpy(fid.group,pszSection,SIZEOF(fid.group)); /* buffer sfae */ + mir_tstrncpy(fid.name,pszDescription,SIZEOF(fid.name)); /* buffer safe */ *pclr=(COLORREF)CallService(MS_FONT_GETT,(WPARAM)&fid,(LPARAM)plf); /* uses fallback font on error */ return (int)*pclr==-1; } @@ -249,10 +249,10 @@ int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,cons ZeroMemory(&cid,sizeof(cid)); cid.cbSize=sizeof(cid); cid.defcolour=clrDefault; - lstrcpynA(cid.dbSettingsGroup,pszDbModule,sizeof(cid.dbSettingsGroup)); /* buffer safe */ - lstrcpynA(cid.setting,pszDbName,sizeof(cid.setting)); /* buffer safe */ - lstrcpyn(cid.group,pszSection,SIZEOF(cid.group)); /* buffer safe */ - lstrcpyn(cid.name,pszDescription,SIZEOF(cid.name)); /* buffer safe */ + mir_strncpy(cid.dbSettingsGroup,pszDbModule,sizeof(cid.dbSettingsGroup)); /* buffer safe */ + mir_strncpy(cid.setting,pszDbName,sizeof(cid.setting)); /* buffer safe */ + mir_tstrncpy(cid.group,pszSection,SIZEOF(cid.group)); /* buffer safe */ + mir_tstrncpy(cid.name,pszDescription,SIZEOF(cid.name)); /* buffer safe */ ColourRegisterT(&cid); return 0; } @@ -262,8 +262,8 @@ int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COL ColourIDT cid; ZeroMemory(&cid,sizeof(cid)); cid.cbSize=sizeof(cid); - lstrcpyn(cid.group,pszSection,sizeof(cid.group)); /* buffer safe */ - lstrcpyn(cid.name,pszDescription,sizeof(cid.name)); /* buffer safe */ + 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; } diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 61686744f4..e95b97f145 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -66,7 +66,7 @@ static void __inline ShutdownAndStopWatcher(void) static TCHAR* GetMessageText(BYTE **ppBlob,DWORD *pcbBlob) { (*ppBlob)[*pcbBlob]=0; - DWORD cb = lstrlenA((char*)*ppBlob); + DWORD cb = mir_strlen((char*)*ppBlob); /* use Unicode data if present */ if (*pcbBlob>(cb+3)) { (*ppBlob)[*pcbBlob-1]=0; -- cgit v1.2.3