From 876268848bfdd6a668ac08f8e767fb8e2a6ca3dc Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 16 May 2015 18:38:16 +0000 Subject: fix for strncat use git-svn-id: http://svn.miranda-ng.org/main/trunk@13644 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SeenPlugin/src/missed.cpp | 2 +- plugins/SeenPlugin/src/utils.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index 9ab533a554..39e925f9bc 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -107,7 +107,7 @@ int ShowMissed(void) TCHAR sztemp[1024], szcount[7]; for (int loop = 0; loop < mcs.count; loop++) { - _tcsncat(sztemp, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, mcs.wpcontact[loop], GCDNF_TCHAR), SIZEOF(sztemp)); + _tcsncat(sztemp, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, mcs.wpcontact[loop], GCDNF_TCHAR), SIZEOF(sztemp) - mir_tstrlen(sztemp)); if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0)) { mir_sntprintf(szcount, SIZEOF(szcount), _T(" [%i]"), mcs.times[loop]); _tcscat(sztemp, szcount); diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 64fa20c6c9..c8de06f57b 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -299,8 +299,8 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "StatusTriger" : courProtoName, 0)) { _tcsncpy(szdbsetting, (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)(isetting | 0x8000), GSMDF_TCHAR), SIZEOF(szdbsetting)); if (!(isetting & 0x8000)) { - _tcsncat(szdbsetting, _T("/"), SIZEOF(szdbsetting)); - _tcsncat(szdbsetting, TranslateT("Idle"), SIZEOF(szdbsetting)); + _tcsncat(szdbsetting, _T("/"), SIZEOF(szdbsetting) - mir_tstrlen(szdbsetting)); + _tcsncat(szdbsetting, TranslateT("Idle"), SIZEOF(szdbsetting) - mir_tstrlen(szdbsetting)); } charPtr = szdbsetting; goto LBL_charPtr; @@ -319,8 +319,8 @@ TCHAR *ParseString(TCHAR *szstring, MCONTACT hcontact, BYTE isfile) if (isetting = db_get_w(hcontact, S_MOD, hcontact ? "OldStatus" : courProtoName, 0)) { _tcsncpy(szdbsetting, (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)isetting, GSMDF_TCHAR), SIZEOF(szdbsetting)); if (includeIdle && hcontact && db_get_b(hcontact, S_MOD, "OldIdle", 0)) { - _tcsncat(szdbsetting, _T("/"), SIZEOF(szdbsetting)); - _tcsncat(szdbsetting, TranslateT("Idle"), SIZEOF(szdbsetting)); + _tcsncat(szdbsetting, _T("/"), SIZEOF(szdbsetting) - mir_tstrlen(szdbsetting)); + _tcsncat(szdbsetting, TranslateT("Idle"), SIZEOF(szdbsetting) - mir_tstrlen(szdbsetting)); } charPtr = szdbsetting; goto LBL_charPtr; -- cgit v1.2.3