summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_userinfo.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-09-22 14:06:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-09-22 14:06:14 +0000
commitfc3a4607ee5cfe9e7cfed8d63e2cb1d549f61d92 (patch)
tree754549fa0a5a62cbf5fa07b93d74bf4f3ab49061 /protocols/JabberG/src/jabber_userinfo.cpp
parent772ba179473fa39074278cad7aae84870c9310b8 (diff)
_tcsncpy -> _tcsncpy_s; strncpy -> strncpy_s
git-svn-id: http://svn.miranda-ng.org/main/trunk@10557 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_userinfo.cpp')
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index aca4c6341f..785b6c6a66 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -661,9 +661,8 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
switch (LOWORD(wParam)) {
case IDC_SAVE:
static TCHAR szFilter[512];
- DWORD n;
- ptrT jid( photoInfo->ppro->getTStringA(photoInfo->hContact, "jid"));
+ ptrT jid(photoInfo->ppro->getTStringA(photoInfo->hContact, "jid"));
if (jid == NULL)
break;
@@ -672,27 +671,22 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
if ((item = photoInfo->ppro->ListGetItemPtr(LIST_ROSTER, jid)) == NULL)
break;
- switch ( ProtoGetAvatarFileFormat(item->photoFileName)) {
+ switch (ProtoGetAvatarFileFormat(item->photoFileName)) {
case PA_FORMAT_BMP:
- n = mir_sntprintf(szFilter, SIZEOF(szFilter), _T("BMP %s (*.bmp)"), TranslateT("format"));
- _tcsncpy(szFilter+n+1, _T("*.BMP"), SIZEOF(szFilter)-n-2);
+ mir_sntprintf(szFilter, SIZEOF(szFilter), _T("BMP %s (*.bmp)%c*.BMP"), TranslateT("format"), 0);
break;
case PA_FORMAT_GIF:
- n = mir_sntprintf(szFilter, SIZEOF(szFilter), _T("GIF %s (*.gif)"), TranslateT("format"));
- _tcsncpy(szFilter+n+1, _T("*.GIF"), SIZEOF(szFilter)-n-2);
+ mir_sntprintf(szFilter, SIZEOF(szFilter), _T("GIF %s (*.gif)%c*.GIF"), TranslateT("format"), 0);
break;
case PA_FORMAT_JPEG:
- n = mir_sntprintf(szFilter, SIZEOF(szFilter), _T("JPEG %s (*.jpg;*.jpeg)"), TranslateT("format"));
- _tcsncpy(szFilter+n+1, _T("*.JPG;*.JPEG"), SIZEOF(szFilter)-n-2);
+ mir_sntprintf(szFilter, SIZEOF(szFilter), _T("JPEG %s (*.jpg;*.jpeg)%c*.JPG;*.JPEG"), TranslateT("format"), 0);
break;
default:
- n = mir_sntprintf(szFilter, SIZEOF(szFilter), _T("%s (*.*)"), TranslateT("Unknown format"));
- _tcsncpy(szFilter+n+1, _T("*.*"), SIZEOF(szFilter)-n-2);
+ mir_sntprintf(szFilter, SIZEOF(szFilter), _T("%s (*.*)%c*.*"), TranslateT("Unknown format"), 0);
}
- szFilter[SIZEOF(szFilter)-1] = 0;
TCHAR szFileName[MAX_PATH]; szFileName[0] = '\0';
OPENFILENAME ofn = { 0 };