From 4955a3b835c8b6d71fa836cdfc0ec5b82fa59ae0 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 21 Jun 2014 20:01:52 +0000 Subject: fixed langpack authors crop git-svn-id: http://svn.miranda-ng.org/main/trunk@9548 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/langpack.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp index b362dc34e3..48d2f15aaa 100644 --- a/src/mir_core/langpack.cpp +++ b/src/mir_core/langpack.cpp @@ -327,14 +327,23 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start return 3; *pszColon++ = 0; - if (!lstrcmpA(line, "Language")) { mir_snprintf(szLanguage, sizeof(szLanguage), "%s", pszColon); lrtrim(szLanguage); } - else if (!lstrcmpA(line, "Last-Modified-Using")) { mir_snprintf(lpinfo.szLastModifiedUsing, sizeof(lpinfo.szLastModifiedUsing), "%s", pszColon); lrtrim(lpinfo.szLastModifiedUsing); } + if (!lstrcmpA(line, "Language")) { + mir_snprintf(szLanguage, sizeof(szLanguage), "%s", pszColon); + lrtrim(szLanguage); + } + else if (!lstrcmpA(line, "Last-Modified-Using")) { + lpinfo.szLastModifiedUsing = pszColon; + lpinfo.szLastModifiedUsing.Trim(); + } else if (!lstrcmpA(line, "Authors")) { if (!szAuthors.IsEmpty()) szAuthors.AppendChar(' '); szAuthors.Append(lrtrim(pszColon)); } - else if (!lstrcmpA(line, "Author-email")) { mir_snprintf(lpinfo.szAuthorEmail, sizeof(lpinfo.szAuthorEmail), "%s", pszColon); lrtrim(lpinfo.szAuthorEmail); } + else if (!lstrcmpA(line, "Author-email")) { + lpinfo.szAuthorEmail = pszColon; + lpinfo.szAuthorEmail.Trim(); + } else if (!lstrcmpA(line, "Locale")) { char szBuf[20], *stopped; @@ -347,7 +356,7 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start } } - strncpy_s(lpinfo.szAuthors, SIZEOF(lpinfo.szAuthors), szAuthors, _TRUNCATE); + lpinfo.szAuthors = szAuthors; MultiByteToWideChar(lpinfo.codepage, 0, szLanguage, -1, lpinfo.tszLanguage, SIZEOF(lpinfo.tszLanguage)); @@ -628,8 +637,6 @@ MIR_CORE_DLL(int) LoadLangPackModule(void) { bModuleInitialized = TRUE; - ZeroMemory(&langPack, sizeof(langPack)); - hevChanged = CreateHookableEvent(ME_LANGPACK_CHANGED); // look into mirandaboot.ini -- cgit v1.2.3