summaryrefslogtreecommitdiff
path: root/protocols/Tlen/src/tlen_avatar.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
commit4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch)
tree9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /protocols/Tlen/src/tlen_avatar.cpp
parentf0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff)
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen/src/tlen_avatar.cpp')
-rw-r--r--protocols/Tlen/src/tlen_avatar.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp
index e0722447a9..d548dc3c31 100644
--- a/protocols/Tlen/src/tlen_avatar.cpp
+++ b/protocols/Tlen/src/tlen_avatar.cpp
@@ -42,7 +42,7 @@ void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* pts
else {
proto->debugLog(_T("getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s"), ptszDest, errno, strerror(errno));
TCHAR buffer[512];
- mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ptszDest);
+ mir_sntprintf(buffer, _countof(buffer), TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ptszDest);
PUShowMessageT(buffer, SM_WARNING);
}
}
@@ -69,7 +69,7 @@ static void RemoveAvatar(TlenProtocol *proto, MCONTACT hContact) {
if (hContact == NULL) {
proto->threadData->avatarHash[0] = '\0';
}
- TlenGetAvatarFileName( proto, NULL, tFileName, SIZEOF(tFileName)-1);
+ TlenGetAvatarFileName( proto, NULL, tFileName, _countof(tFileName)-1);
DeleteFile(tFileName);
db_unset(hContact, "ContactPhoto", "File");
db_unset(hContact, proto->m_szModuleName, "AvatarHash");
@@ -100,7 +100,7 @@ static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *it
proto->threadData->avatarFormat = format;
mir_strcpy(proto->threadData->avatarHash, md5);
}
- TlenGetAvatarFileName(proto, item, filename, SIZEOF(filename)-1);
+ TlenGetAvatarFileName(proto, item, filename, _countof(filename)-1);
DeleteFile(filename);
FILE *out = _tfopen(filename, TEXT("wb") );
if (out != NULL) {
@@ -111,7 +111,7 @@ static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *it
db_set_dw(hContact, proto->m_szModuleName, "AvatarFormat", format);
} else {
TCHAR buffer[128];
- mir_sntprintf(buffer, SIZEOF(buffer), TranslateT("Cannot save new avatar file \"%s\" Error:\n\t%s (Error: %d)"), filename, _tcserror(errno), errno);
+ mir_sntprintf(buffer, _countof(buffer), TranslateT("Cannot save new avatar file \"%s\" Error:\n\t%s (Error: %d)"), filename, _tcserror(errno), errno);
PUShowMessageT(buffer, SM_WARNING);
proto->debugLog(buffer);
return;