From 6fcfba2c46a456677b5825a899469ba4e8905448 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 23 May 2015 17:49:58 +0000 Subject: replace strncpy to mir_strncpy git-svn-id: http://svn.miranda-ng.org/main/trunk@13785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeClassic/src/filexfer.cpp | 4 ++-- protocols/SkypeClassic/src/skype.cpp | 6 +++--- protocols/SkypeClassic/src/skypeapi.cpp | 4 ++-- protocols/SkypeClassic/src/skypeopt.cpp | 4 ++-- protocols/SkypeClassic/src/skypeprofile.cpp | 2 +- protocols/SkypeClassic/src/skypeproxy/skypeproxy.c | 2 +- protocols/SkypeClassic/src/skypesvc.cpp | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) (limited to 'protocols/SkypeClassic') diff --git a/protocols/SkypeClassic/src/filexfer.cpp b/protocols/SkypeClassic/src/filexfer.cpp index 313af9a315..5a8ff3df76 100644 --- a/protocols/SkypeClassic/src/filexfer.cpp +++ b/protocols/SkypeClassic/src/filexfer.cpp @@ -366,7 +366,7 @@ BOOL FXHandleMessage(const char *pszMsg) if (!pTok) return FALSE; - strncpy(args.szNum, pszMsg, pTok - pszMsg); + mir_strncpy(args.szNum, pszMsg, pTok - pszMsg); pszMsg = pTok + 1; if (!(pTok = strchr(pszMsg, ' '))) return FALSE; pTok++; @@ -374,7 +374,7 @@ BOOL FXHandleMessage(const char *pszMsg) return FALSE; ft_args *pargs = (ft_args*)malloc(sizeof(args)); if (!pargs) return TRUE; - strncpy(args.szArg, pTok, sizeof(args.szArg)); + mir_strncpy(args.szArg, pTok, sizeof(args.szArg)); memcpy(pargs, &args, sizeof(args)); pthread_create((pThreadFunc)FXHandleMessageThread, pargs); return TRUE; diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index 147b467ecc..14a4363533 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -1387,7 +1387,7 @@ void MessageListProcessingThread(char *str) { // Frst we need to sort the message timestamps for ((token = strtok_r(str+1, ", ", &nextoken)); token; token = strtok_r(NULL, ", ", &nextoken)) { if (args = (fetchmsg_arg*)calloc(1, sizeof(fetchmsg_arg) + sizeof(DWORD))) { - strncpy(args->msgnum, token, sizeof(args->msgnum)-1); + mir_strncpy(args->msgnum, token, sizeof(args->msgnum)-1); args->getstatus = TRUE; args->bIsRead = *str; args->bDontMarkSeen = *str; @@ -2163,7 +2163,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) // If new message is available, fetch it ptr[0] = 0; if (!(args = (fetchmsg_arg *)calloc(1, sizeof(*args)))) break; - strncpy(args->msgnum, pMsgNum, sizeof(args->msgnum)-1); + mir_strncpy(args->msgnum, pMsgNum, sizeof(args->msgnum)-1); args->getstatus = FALSE; //args->bIsRead = strncmp(ptr+8, "READ", 4) == 0; pthread_create((pThreadFunc)FetchMessageThreadSync, args); @@ -2467,7 +2467,7 @@ void RetrieveUserAvatar(void *param) // Got it MoveFileExA(pszTempFile, AvatarFile, MOVEFILE_REPLACE_EXISTING); AI.format = PA_FORMAT_JPEG; - strncpy(AI.filename, AvatarFile,SIZEOF(AI.filename)-1); + mir_strncpy(AI.filename, AvatarFile,SIZEOF(AI.filename)-1); ack.hProcess = (HANDLE)&AI; } diff --git a/protocols/SkypeClassic/src/skypeapi.cpp b/protocols/SkypeClassic/src/skypeapi.cpp index ad6bc71967..e86658e69f 100644 --- a/protocols/SkypeClassic/src/skypeapi.cpp +++ b/protocols/SkypeClassic/src/skypeapi.cpp @@ -518,7 +518,7 @@ char *SkypeRcvMsg(char *what, time_t st, MCONTACT hContact, DWORD maxwait) // isn't using the ID anymore, so we have to save the ID as new identifier for message recognition pCurMsg+=iLenWhat; if ((pMsg = strchr (pCurMsg, ' ')) && (pMsg=strchr (pMsg+1, ' '))) - strncpy (msgid, pCurMsg, pMsg-pCurMsg); + mir_strncpy (msgid, pCurMsg, pMsg-pCurMsg); else if (strncmp (pCurMsg, "ERROR", 5) == 0) bIsError = TRUE; } @@ -1171,7 +1171,7 @@ INT_PTR SkypeSetAvatar(WPARAM wParam, LPARAM lParam) { // Backup old file if (hasOldAvatar) { - strncpy(OldAvatarFile, dbv.pszVal, sizeof(OldAvatarFile)-4); + mir_strncpy(OldAvatarFile, dbv.pszVal, sizeof(OldAvatarFile)-4); OldAvatarFile[sizeof(OldAvatarFile)-5] = '\0'; mir_strcat(OldAvatarFile, "_old"); DeleteFileA(OldAvatarFile); diff --git a/protocols/SkypeClassic/src/skypeopt.cpp b/protocols/SkypeClassic/src/skypeopt.cpp index 358a95e153..fb35c5f483 100644 --- a/protocols/SkypeClassic/src/skypeopt.cpp +++ b/protocols/SkypeClassic/src/skypeopt.cpp @@ -611,12 +611,12 @@ INT_PTR CALLBACK OptionsDefaultDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L db_set_b (NULL, SKYPE_PROTONAME, "secondary", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SECONDARY))); GetDlgItemTextA(hwndDlg,IDC_COMMANDLINE,text,SIZEOF(text)); - strncpy(szRelativePath, text, sizeof(szRelativePath)-1); + mir_strncpy(szRelativePath, text, sizeof(szRelativePath)-1); CallService (MS_UTILS_PATHTORELATIVE, (WPARAM)text, (LPARAM)szRelativePath); db_set_s(NULL, SKYPE_PROTONAME, "CommandLine", szRelativePath); GetDlgItemTextA(hwndDlg,IDC_DATAPATH,text,SIZEOF(text)); - strncpy(szRelativePath, text, sizeof(szRelativePath)-1); + mir_strncpy(szRelativePath, text, sizeof(szRelativePath)-1); CallService (MS_UTILS_PATHTORELATIVE, (WPARAM)text, (LPARAM)szRelativePath); db_set_s(NULL, SKYPE_PROTONAME, "datapath", szRelativePath); diff --git a/protocols/SkypeClassic/src/skypeprofile.cpp b/protocols/SkypeClassic/src/skypeprofile.cpp index 045a5b7d78..b796a96667 100644 --- a/protocols/SkypeClassic/src/skypeprofile.cpp +++ b/protocols/SkypeClassic/src/skypeprofile.cpp @@ -105,7 +105,7 @@ static void LoadSaveSkype(SkypeProfile *pstProf, BOOL bSet) if (astSettings[i].cType == sizeof(char)) { char *pBuf; if (utf8_decode (ptr, &pBuf) != -1) { - strncpy ((char*)astSettings[i].lpDest, pBuf, astSettings[i].iSize); + mir_strncpy ((char*)astSettings[i].lpDest, pBuf, astSettings[i].iSize); free (pBuf); } } else { diff --git a/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c b/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c index 200b79632a..0802788e10 100644 --- a/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c +++ b/protocols/SkypeClassic/src/skypeproxy/skypeproxy.c @@ -520,7 +520,7 @@ int main(int argc, char *argv[]) { } for (i=0;ii+1) - strncpy(BindIP, argv[i+1], sizeof(BindIP)); + mir_strncpy(BindIP, argv[i+1], sizeof(BindIP)); if (!mir_strcmpi(argv[i], "-p") && argc>i+1) if (!(BindPort=atoi(argv[i+1]))) { OUTPUT("ERROR: Cannot convert port to int. bye.."); diff --git a/protocols/SkypeClassic/src/skypesvc.cpp b/protocols/SkypeClassic/src/skypesvc.cpp index fae8b8cd3b..e893721e42 100644 --- a/protocols/SkypeClassic/src/skypesvc.cpp +++ b/protocols/SkypeClassic/src/skypesvc.cpp @@ -147,7 +147,7 @@ INT_PTR SkypeGetName(WPARAM wParam, LPARAM lParam) { if (lParam) { - strncpy((char *)lParam, SKYPE_PROTONAME, wParam); + mir_strncpy((char *)lParam, SKYPE_PROTONAME, wParam); return 0; // Success } return 1; // Failure -- cgit v1.2.3