summaryrefslogtreecommitdiff
path: root/src/mir_core/langpack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir_core/langpack.cpp')
-rw-r--r--src/mir_core/langpack.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp
index 64a94bc57c..2fadf0f073 100644
--- a/src/mir_core/langpack.cpp
+++ b/src/mir_core/langpack.cpp
@@ -394,11 +394,10 @@ MIR_CORE_DLL(int) LoadLangPackDescr(const TCHAR *szLangPack, LANGPACK_INFO *lpIn
if (lpInfo == NULL)
return 1;
- lstrcpy(lpInfo->tszFileName, szLangPack);
- lstrcpy(lpInfo->tszFullPath, szLangPack);
+ _tcsncpy_s(lpInfo->tszFullPath, SIZEOF(lpInfo->tszFullPath), szLangPack, _TRUNCATE);
TCHAR *p = _tcsrchr(lpInfo->tszFullPath, '\\');
- if (p)
- p[1] = 0;
+ _tcsncpy_s(lpInfo->tszFileName, SIZEOF(lpInfo->tszFullPath), (p == NULL) ? szLangPack : p+1, _TRUNCATE);
+ CharLower(lpInfo->tszFileName);
FILE *fp = _tfopen(szLangPack, _T("rt"));
if (fp == NULL)