diff options
-rw-r--r-- | plugins/Clist_modern/src/modern_skinopt.cpp | 12 |
1 files 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); } |