diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-02 21:55:57 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-02 21:55:57 +0000 |
commit | 0ca0de7698b523effaaf6cc9c608e936fa5aaf86 (patch) | |
tree | 1e6ce038dc27a1ccddb5e3f863607c83eece2e98 /protocols/GTalkExt/src/avatar.cpp | |
parent | aeae01dc50a5adea8fe003c8195540b1f2b2169f (diff) |
useless calls of mir_*strlen in DrawText replaced with -1
git-svn-id: http://svn.miranda-ng.org/main/trunk@11223 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/GTalkExt/src/avatar.cpp')
-rw-r--r-- | protocols/GTalkExt/src/avatar.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp index 4f3e848c4b..433ac0db65 100644 --- a/protocols/GTalkExt/src/avatar.cpp +++ b/protocols/GTalkExt/src/avatar.cpp @@ -33,21 +33,18 @@ LPTSTR CreateAvaFile(HANDLE *hFile)
{
TCHAR name[MAX_PATH + 2];
- TCHAR path[MAX_PATH + 2];
- TCHAR full[MAX_PATH + 2];
-
if (CallService(MS_DB_GETPROFILENAMET, (WPARAM)SIZEOF(name), (LPARAM)&name))
return NULL;
- for (int i = mir_tstrlen(name); i >= 0; i--)
- if ('.' == name[i]) {
- name[i] = 0;
- break;
- }
+ TCHAR *p = _tcsrchr(name, '.');
+ if (p)
+ *p = 0;
+ TCHAR path[MAX_PATH + 2];
if (CallService(MS_DB_GETPROFILEPATHT, (WPARAM)SIZEOF(path), (LPARAM)&path))
return NULL;
+ TCHAR full[MAX_PATH + 2];
mir_sntprintf(full, SIZEOF(full), AVA_FILE_NAME_FORMAT, path, name);
CreateDirectoryTreeT(full);
|