From babf7873a3fe373d60ef22b1b671d98e014d8819 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 22 May 2015 19:52:29 +0000 Subject: replace strcpy to mir_strcpy git-svn-id: http://svn.miranda-ng.org/main/trunk@13763 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdfile/src/file.cpp | 4 ++-- src/core/stdmsg/src/msglog.cpp | 8 ++++---- src/modules/chat/log.cpp | 2 +- src/modules/clist/contacts.cpp | 4 ++-- src/modules/database/mdatabasecache.cpp | 8 ++++---- src/modules/netlib/netlibhttp.cpp | 2 +- src/modules/protocols/protodir.cpp | 2 +- src/modules/utils/path.cpp | 2 +- src/modules/xml/xmlParser.cpp | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index fbe092784a..af5483841d 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -412,13 +412,13 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam) *(DWORD*)dbei.pBlob = 0; BYTE* p = dbei.pBlob + sizeof(DWORD); for (int i = 0; i < pre->fileCount; i++) { - strcpy((char*)p, pszFiles[i]); + mir_strcpy((char*)p, pszFiles[i]); p += mir_strlen(pszFiles[i]) + 1; if (bUnicode) mir_free(pszFiles[i]); } - strcpy((char*)p, (szDescr == NULL) ? "" : szDescr); + mir_strcpy((char*)p, (szDescr == NULL) ? "" : szDescr); if (bUnicode) mir_free(szDescr); diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index f3e13ccd9d..4852cf91d1 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -85,7 +85,7 @@ static int AppendToBufferWithRTF(char *&buffer, size_t &cbBufferEnd, size_t &cbB } d = buffer + cbBufferEnd; - strcpy(d, "{\\uc1 "); + mir_strcpy(d, "{\\uc1 "); d += 6; for (; *line; line++, textCharsCount++) { @@ -482,8 +482,8 @@ void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend) SendMessage(hwndLog, EM_EXSETSEL, 0, (LPARAM)& sel); } - strcpy(szSep2, fAppend ? "\\par\\sl0" : "\\sl1000"); - strcpy(szSep2_RTL, fAppend ? "\\rtlpar\\rtlmark\\par\\sl1000" : "\\sl1000"); + mir_strcpy(szSep2, fAppend ? "\\par\\sl0" : "\\sl1000"); + mir_strcpy(szSep2_RTL, fAppend ? "\\rtlpar\\rtlmark\\par\\sl1000" : "\\sl1000"); SendMessage(hwndLog, EM_STREAMIN, fAppend ? SFF_SELECTION | SF_RTF : SF_RTF, (LPARAM)& stream); if (bottomScroll) { @@ -545,7 +545,7 @@ void LoadMsgLogIcons(void) char *szDest = pLogIconBmpBits[i] + rtfHeaderSize; bin2hex(&bih, sizeof(bih), szDest); szDest += sizeof(bih) * 2; bin2hex(pBmpBits, widthBytes * bih.biHeight, szDest); szDest += widthBytes * bih.biHeight * 2; - strcpy(szDest, "}"); + mir_strcpy(szDest, "}"); logIconBmpSize[i] = size_t(szDest - pLogIconBmpBits[i]) + 1; } diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp index 9be458b09d..9fc6d5b20a 100644 --- a/src/modules/chat/log.cpp +++ b/src/modules/chat/log.cpp @@ -509,7 +509,7 @@ void LoadMsgLogBitmaps(void) char *szDest = pLogIconBmpBits[i] + rtfHeaderSize; bin2hex(&bih, sizeof(bih), szDest); szDest += sizeof(bih) * 2; bin2hex(pBmpBits, widthBytes * bih.biHeight, szDest); szDest += widthBytes * bih.biHeight * 2; - strcpy(szDest, "}"); + mir_strcpy(szDest, "}"); logIconBmpSize[i] = size_t(szDest - pLogIconBmpBits[i]) + 1; } diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp index 2f04fe4c1e..0d3adeabbf 100644 --- a/src/modules/clist/contacts.cpp +++ b/src/modules/clist/contacts.cpp @@ -194,7 +194,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) size_t len = mir_strlen(dbv.pszVal) + mir_strlen(dbv2.pszVal) + 2; char* buf = (char*)mir_alloc(len); if (buf != NULL) - strcat(strcat(strcpy(buf, dbv.pszVal), " "), dbv2.pszVal); + strcat(strcat(mir_strcpy(buf, dbv.pszVal), " "), dbv2.pszVal); ci->pszVal = (TCHAR*)buf; } db_free(&dbv); @@ -319,7 +319,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam) size_t len = mir_strlen(dbv.pszVal) + mir_strlen(dbv2.pszVal) + 2; char* buf = (char*)mir_alloc(len); if (buf != NULL) - strcat(strcat(strcpy(buf, dbv.pszVal), " "), dbv2.pszVal); + strcat(strcat(mir_strcpy(buf, dbv.pszVal), " "), dbv2.pszVal); ci->pszVal = (TCHAR*)buf; } diff --git a/src/modules/database/mdatabasecache.cpp b/src/modules/database/mdatabasecache.cpp index 14eecc97ec..ffc9631d77 100644 --- a/src/modules/database/mdatabasecache.cpp +++ b/src/modules/database/mdatabasecache.cpp @@ -121,7 +121,7 @@ char* MDatabaseCache::InsertCachedSetting(const char* szName, int cbLen) { char* newValue = (char*)HeapAlloc(m_hCacheHeap, 0, cbLen); *newValue++ = 0; - strcpy(newValue, szName); + mir_strcpy(newValue, szName); m_lSettings.insert(newValue); return newValue; } @@ -131,9 +131,9 @@ char* MDatabaseCache::GetCachedSetting(const char *szModuleName, const char *szS char szFullName[512]; const char *szKey; if (szModuleName != NULL) { - strcpy(szFullName, szModuleName); + mir_strcpy(szFullName, szModuleName); szFullName[moduleNameLen] = '/'; - strcpy(szFullName + moduleNameLen + 1, szSettingName); + mir_strcpy(szFullName + moduleNameLen + 1, szSettingName); szKey = szFullName; } else szKey = szSettingName; @@ -160,7 +160,7 @@ void MDatabaseCache::SetCachedVariant(DBVARIANT* s /* new */, DBVARIANT* d /* ca d->pszVal = (char*)HeapReAlloc(m_hCacheHeap, 0, szSave, mir_strlen(s->pszVal) + 1); else d->pszVal = (char*)HeapAlloc(m_hCacheHeap, 0, mir_strlen(s->pszVal) + 1); - strcpy(d->pszVal, s->pszVal); + mir_strcpy(d->pszVal, s->pszVal); } else if (szSave != NULL) HeapFree(m_hCacheHeap, 0, szSave); diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp index 0fa5d91f42..cd7a173f1a 100644 --- a/src/modules/netlib/netlibhttp.cpp +++ b/src/modules/netlib/netlibhttp.cpp @@ -584,7 +584,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) nlc->szNewUrl = (char*)mir_realloc(nlc->szNewUrl, rlen + mir_strlen(tmpUrl) * 3 + 1); strncpy(nlc->szNewUrl, pszFullUrl, rlen); - strcpy(nlc->szNewUrl + rlen, tmpUrl); + mir_strcpy(nlc->szNewUrl + rlen, tmpUrl); pszFullUrl = nlc->szNewUrl; pszUrl = NULL; diff --git a/src/modules/protocols/protodir.cpp b/src/modules/protocols/protodir.cpp index 0ce11742ed..672fb7f007 100644 --- a/src/modules/protocols/protodir.cpp +++ b/src/modules/protocols/protodir.cpp @@ -108,7 +108,7 @@ char * contactDir_Proto_Add(contactDir * cd, char * proto) if ( List_GetIndex(&cd->protoNameCache, proto, &index) ) szCache = cd->protoNameCache.items[index]; else { szCache = HeapAlloc(hCacheHeap, HEAP_NO_SERIALIZE, mir_strlen(proto)+1); - strcpy(szCache, proto); + mir_strcpy(szCache, proto); List_Insert(&cd->protoNameCache, szCache, index); } return szCache; diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index 8fb4ed3e98..0a9c1123ad 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -108,7 +108,7 @@ TCHAR *GetContactID(MCONTACT hContact) static __forceinline int _xcscmp(const char *s1, const char *s2) { return mir_strcmp(s1, s2); } static __forceinline int _xcsncmp(const char *s1, const char *s2, size_t n) { return strncmp(s1, s2, n); } static __forceinline size_t _xcslen(const char *s1) { return mir_strlen(s1); } -static __forceinline char *_xcscpy(char *s1, const char *s2) { return strcpy(s1, s2); } +static __forceinline char *_xcscpy(char *s1, const char *s2) { return mir_strcpy(s1, s2); } static __forceinline char *_xcsncpy(char *s1, const char *s2, size_t n) { return strncpy(s1, s2, n); } static __forceinline char *_xstrselect(char *, char *s1, TCHAR *s2) { return s1; } static __forceinline char *_itox(char *, int a) { return itoa(a, (char *)mir_alloc(sizeof(char)*20), 10); } diff --git a/src/modules/xml/xmlParser.cpp b/src/modules/xml/xmlParser.cpp index 61b5bb6f58..79eb1fc6e1 100644 --- a/src/modules/xml/xmlParser.cpp +++ b/src/modules/xml/xmlParser.cpp @@ -246,7 +246,7 @@ static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return _stricmp(c1, c2); } #endif static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncmp(c1, c2, l);} static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)strstr(c1, c2); } -static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)strcpy(c1, c2); } +static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)mir_strcpy(c1, c2); } #endif #else // for gcc and CC @@ -330,7 +330,7 @@ static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncasecmp( static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncmp(c1, c2, l);} static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return strcasecmp(c1, c2); } static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)strstr(c1, c2); } -static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)strcpy(c1, c2); } +static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)mir_strcpy(c1, c2); } #endif static inline int _strnicmp(const char *c1, const char *c2, int l) { return strncasecmp(c1, c2, l);} #endif -- cgit v1.2.3