From f8c2ad822cfd7cf7091ac85e3bec5747433646f1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 7 Jun 2015 21:20:21 +0000 Subject: fixed chinese in Clist_modern skin options dialog git-svn-id: http://svn.miranda-ng.org/main/trunk@14062 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_skinopt.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 23423c8df5..5c603ad699 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -409,16 +409,16 @@ HTREEITEM AddSkinToList(HWND hwndDlg, TCHAR * path, TCHAR* file) return 0; if (!file || _tcschr(file, _T('%'))) { - mir_sntprintf(sd->File, SIZEOF(sd->File), _T("%%Default Skin%%")); - mir_sntprintf(sd->Name, SIZEOF(sd->Name), TranslateT("%Default Skin%")); - mir_tstrncpy(fullName, TranslateT("Default Skin"), SIZEOF(fullName)); + mir_sntprintf(sd->File, _T("%%Default Skin%%")); + mir_sntprintf(sd->Name, TranslateT("%Default Skin%")); + _tcsncpy_s(fullName, TranslateT("Default Skin"), _TRUNCATE); } else { mir_sntprintf(fullName, SIZEOF(fullName), _T("%s\\%s"), path, file); - memcpy(defskinname, file, (mir_tstrlen(file) - 4) * sizeof(TCHAR)); - defskinname[mir_tstrlen(file) + 1] = _T('\0'); + _tcsncpy_s(defskinname, file, _TRUNCATE); + TCHAR *p = _tcsrchr(defskinname, '.'); if (p) *p = 0; GetPrivateProfileString(_T("Skin_Description_Section"), _T("Name"), defskinname, sd->Name, SIZEOF(sd->Name), fullName); - mir_tstrcpy(sd->File, fullName); + _tcsncpy_s(sd->File, fullName, _TRUNCATE); } return AddItemToTree(GetDlgItem(hwndDlg, IDC_TREE1), sd->Name, sd); } -- cgit v1.2.3