mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 14:35:59 +00:00
[INTL]
- fix a leak - fix a buffer overrun CID #503741 CID #716119 svn path=/trunk/; revision=62685
This commit is contained in:
parent
5cd83d03a1
commit
7fe5a44dfa
2 changed files with 13 additions and 4 deletions
|
@ -57,6 +57,9 @@ FindDateSep(const TCHAR *szSourceStr)
|
|||
|
||||
pszFoundSep = (LPTSTR)malloc(MAX_SAMPLES_STR_SIZE * sizeof(TCHAR));
|
||||
|
||||
if(!pszFoundSep)
|
||||
return NULL;
|
||||
|
||||
_tcscpy(pszFoundSep,STD_DATE_SEP);
|
||||
|
||||
while (nDateCompCount < _tcslen(szSourceStr))
|
||||
|
@ -121,8 +124,9 @@ SetShortDateFormat(HWND hwndDlg, LCID lcid)
|
|||
{
|
||||
TCHAR szShortDateFmt[MAX_SAMPLES_STR_SIZE];
|
||||
TCHAR szShortDateSep[MAX_SAMPLES_STR_SIZE];
|
||||
TCHAR szFindedDateSep[MAX_SAMPLES_STR_SIZE];
|
||||
TCHAR szFoundDateSep[MAX_SAMPLES_STR_SIZE];
|
||||
LPTSTR pszResultStr;
|
||||
LPTSTR pszFoundSep;
|
||||
BOOL OpenApostFlg = FALSE;
|
||||
INT nFmtStrSize;
|
||||
INT nDateCompCount;
|
||||
|
@ -166,12 +170,17 @@ SetShortDateFormat(HWND hwndDlg, LCID lcid)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
pszFoundSep = FindDateSep(szShortDateFmt);
|
||||
|
||||
/* Substring replacement of separator */
|
||||
_tcscpy(szFindedDateSep, FindDateSep(szShortDateFmt));
|
||||
pszResultStr = ReplaceSubStr(szShortDateFmt, szShortDateSep, szFindedDateSep);
|
||||
_tcscpy(szFoundDateSep, pszFoundSep);
|
||||
pszResultStr = ReplaceSubStr(szShortDateFmt, szShortDateSep, szFoundDateSep);
|
||||
_tcscpy(szShortDateFmt, pszResultStr);
|
||||
free(pszResultStr);
|
||||
|
||||
if(pszFoundSep)
|
||||
free(pszFoundSep);
|
||||
|
||||
/* Save short date format */
|
||||
SetLocaleInfo(lcid, LOCALE_SSHORTDATE, szShortDateFmt);
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ CreateSortList(HWND hwnd, LCID lcid)
|
|||
|
||||
/* Select current locale */
|
||||
/* or should it be System and not user? */
|
||||
GetLocaleInfo(lcid, LOCALE_SSORTNAME, lang, sizeof(lang));
|
||||
GetLocaleInfo(lcid, LOCALE_SSORTNAME, lang, sizeof(lang)/sizeof(TCHAR));
|
||||
|
||||
SendMessage(hwnd,
|
||||
CB_SELECTSTRING,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue