From eb4bef1f28e6b255c39b4e79763d3048c256313e Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Fri, 25 Jan 2013 18:07:53 +0000 Subject: - SecureIM: options fix (patch from person) git-svn-id: http://svn.miranda-ng.org/main/trunk@3286 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SecureIM/src/options.cpp | 43 ++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'plugins/SecureIM') diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 0d0e422c4b..7058c9c90a 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1782,8 +1782,18 @@ BOOL ShowSelectKeyDlg(HWND hParent, LPSTR KeyPath) ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON; ofn.lpstrFile = KeyPath; - TCHAR temp[MAX_PATH] = _T(""); - mir_sntprintf(temp, sizeof(temp), _T("%s\0*.asc\0%s(*.*)\0*.*\0"), TranslateT("ASC files"), TranslateT("All files ")); + TCHAR temp[MAX_PATH+1] = _T(""); + TCHAR *ftemp; + _tcscpy(temp, TranslateT("ASC files")); + strcat(temp, _T(" (*.asc)")); + ftemp = temp + _tcslen(temp) + 1; + _tcscpy(ftemp, _T("*.asc")); + ftemp = ftemp + _tcslen(ftemp) + 1; + _tcscpy(ftemp, TranslateT("All Files ")); + ftemp = ftemp + _tcslen(ftemp) + 1; + _tcscpy(ftemp, _T("*.*")); + ftemp = ftemp + _tcslen(ftemp) + 1; + *ftemp = _T('\0'); ofn.lpstrFilter = temp; ofn.lpstrTitle = TranslateT("Open Key File"); if (!GetOpenFileName(&ofn)) return FALSE; @@ -1853,8 +1863,19 @@ BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) ofn.nMaxFile = MAX_PATH; ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON; ofn.lpstrFile = szFile; - TCHAR temp[MAX_PATH] = _T(""); - mir_sntprintf(temp, sizeof(temp), _T("%s\0*.asc\0%s(*.*)\0*.*\0"), TranslateT("ASC files"), TranslateT("All files ")); + + TCHAR temp[MAX_PATH+1] = _T(""); + TCHAR *ftemp; + _tcscpy(temp, TranslateT("ASC files")); + strcat(temp, _T(" (*.asc)")); + ftemp = temp + _tcslen(temp) + 1; + _tcscpy(ftemp, _T("*.asc")); + ftemp = ftemp + _tcslen(ftemp) + 1; + _tcscpy(ftemp, TranslateT("All Files ")); + ftemp = ftemp + _tcslen(ftemp) + 1; + _tcscpy(ftemp, _T("*.*")); + ftemp = ftemp + _tcslen(ftemp) + 1; + *ftemp = _T('\0'); ofn.lpstrFilter = temp; ofn.lpstrTitle = (priv) ? TranslateT("Save Private Key File") : TranslateT("Save Public Key File"); if (!GetSaveFileName(&ofn)) return FALSE; @@ -1879,8 +1900,18 @@ BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) ofn.nMaxFile = MAX_PATH; ofn.Flags = OFN_EXPLORER | OFN_CREATEPROMPT | OFN_OVERWRITEPROMPT | OFN_NOREADONLYRETURN; ofn.lpstrFile = szFile; - TCHAR temp[MAX_PATH] = _T(""); - mir_sntprintf(temp, sizeof(temp), _T("%s\0*.asc\0%s(*.*)\0*.*\0"), TranslateT("ASC files"), TranslateT("All files ")); + TCHAR temp[MAX_PATH+1] = _T(""); + TCHAR *ftemp; + _tcscpy(temp, TranslateT("ASC files")); + strcat(temp, _T(" (*.asc)")); + ftemp = temp + _tcslen(temp) + 1; + _tcscpy(ftemp, _T("*.asc")); + ftemp = ftemp + _tcslen(ftemp) + 1; + _tcscpy(ftemp, TranslateT("All Files ")); + ftemp = ftemp + _tcslen(ftemp) + 1; + _tcscpy(ftemp, _T("*.*")); + ftemp = ftemp + _tcslen(ftemp) + 1; + *ftemp = _T('\0'); ofn.lpstrFilter = temp; ofn.lpstrTitle = (priv) ? TranslateT("Load Private Key File") : TranslateT("Load Public Key File"); if (!GetOpenFileName(&ofn)) return FALSE; -- cgit v1.2.3