diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-16 13:43:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-16 13:43:06 +0000 |
commit | eefe0f0d556fbf3d77602d0a99b9134505050756 (patch) | |
tree | 41eef7b1ea9fca98c8e22be29ba0eb07fffb19e1 /plugins/AVS/src | |
parent | 9d8530d69c5896d91e8e9468e769a4eafb9cc53b (diff) |
in _tcsncpy_s / _tcsncat_s / strncpy_s / strncat_s the second parameter to be omitted if the size of first one is fixed (not to contaminate sources with the excessive code)
git-svn-id: http://svn.miranda-ng.org/main/trunk@9829 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AVS/src')
-rw-r--r-- | plugins/AVS/src/cache.cpp | 16 | ||||
-rw-r--r-- | plugins/AVS/src/utils.cpp | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 4e7c28bdab..999d9cba53 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -172,13 +172,13 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node = NULL, AVATARCACHEENTRY // Get hash
char *szProto = GetContactProto(hContact);
if (szProto != NULL) {
- DBVARIANT dbv = {0};
- if ( !db_get_s(hContact, szProto, "AvatarHash", &dbv)) {
+ DBVARIANT dbv = { 0 };
+ if (!db_get_s(hContact, szProto, "AvatarHash", &dbv)) {
if (dbv.type == DBVT_TCHAR)
- _tcsncpy_s(cacn.hash, SIZEOF(cacn.hash), dbv.ptszVal, _TRUNCATE);
+ _tcsncpy_s(cacn.hash, dbv.ptszVal, _TRUNCATE);
else if (dbv.type == DBVT_BLOB) {
- ptrA szHash( mir_base64_encode(dbv.pbVal, dbv.cpbVal));
- _tcsncpy_s(cacn.hash, SIZEOF(cacn.hash), _A2T(szHash), _TRUNCATE);
+ ptrA szHash(mir_base64_encode(dbv.pbVal, dbv.cpbVal));
+ _tcsncpy_s(cacn.hash, _A2T(szHash), _TRUNCATE);
}
db_free(&dbv);
}
@@ -206,7 +206,7 @@ void DeleteAvatarFromCache(MCONTACT hContact, BOOL forever) hContact = GetContactThatHaveTheAvatar(hContact);
CacheNode *node = FindAvatarInCache(hContact, FALSE);
if (node == NULL) {
- struct CacheNode temp_node = {0};
+ struct CacheNode temp_node = { 0 };
temp_node.dwFlags |= (db_mc_isSub(hContact) ? MC_ISSUBCONTACT : 0);
NotifyMetaAware(hContact, &temp_node, (AVATARCACHEENTRY *)GetProtoDefaultAvatar(hContact));
return;
@@ -252,10 +252,10 @@ void PicLoader(LPVOID param) else if (dwDelay > 100)
dwDelay = 100;
- while(!g_shutDown) {
+ while (!g_shutDown) {
CacheNode *node = g_Cache;
- while(!g_shutDown && node) {
+ while (!g_shutDown && node) {
if (node->mustLoad > 0 && node->ace.hContact) {
node->mustLoad = 0;
AVATARCACHEENTRY ace_temp;
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 244282cc25..e4ab45e2ff 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -244,7 +244,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) if ( lstrlen(tszFilename) < 4)
return -1;
- _tcsncpy_s(tszFilename, SIZEOF(tszFilename), VARST(tszFilename), _TRUNCATE);
+ _tcsncpy_s(tszFilename, VARST(tszFilename), _TRUNCATE);
if ((hFile = CreateFile(tszFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE)
return -2;
|