diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-14 10:14:51 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-14 10:14:51 +0000 |
commit | 09934120a7e3b080f5f79f26da3b3bc2946753ee (patch) | |
tree | 4bdf7b757c5e218a03ef43be51dbd8adf7de4639 /protocols/JabberG/src/jabber_userinfo.cpp | |
parent | cb56b3c8913ff8ea50a92a6b74e0342d6377a235 (diff) |
Jabber: warning level 4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11395 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_userinfo.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_userinfo.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 543f6c40f4..14c509c7b2 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -38,8 +38,7 @@ struct UserInfoStringBuf enum { STRINGBUF_INCREMENT = 1024 }; TCHAR *buf; - int size; - int offset; + size_t size, offset; UserInfoStringBuf() { buf = 0; size = 0; offset = 0; } ~UserInfoStringBuf() { mir_free(buf); } @@ -47,7 +46,7 @@ struct UserInfoStringBuf void append(TCHAR *str) { if (!str) return; - int length = mir_tstrlen(str); + size_t length = mir_tstrlen(str); if (size - offset < length + 1) { size += (length + STRINGBUF_INCREMENT); buf = (TCHAR *)mir_realloc(buf, size * sizeof(TCHAR)); @@ -56,7 +55,7 @@ struct UserInfoStringBuf offset += length; } - TCHAR *allocate(int length) { + TCHAR* allocate(int length) { if (size - offset < length) { size += (length + STRINGBUF_INCREMENT); buf = (TCHAR *)mir_realloc(buf, size * sizeof(TCHAR)); @@ -258,8 +257,9 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti // Idle if (r->m_dwIdleStartTime > 0) { mir_tstrncpy(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf)); - int len = mir_tstrlen(buf); - if (len > 0) buf[len-1] = 0; + size_t len = _tcslen(buf); + if (len > 0) + buf[len-1] = 0; } else if (!r->m_dwIdleStartTime) mir_tstrncpy(buf, TranslateT("unknown"), SIZEOF(buf)); @@ -366,8 +366,9 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM JABBER_RESOURCE_STATUS *r = item->getTemp(); if (r->m_dwIdleStartTime > 0) { mir_tstrncpy(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf)); - int len = mir_tstrlen(buf); - if (len > 0) buf[len-1] = 0; + size_t len = _tcslen(buf); + if (len > 0) + buf[len-1] = 0; } else if (!r->m_dwIdleStartTime) mir_tstrncpy(buf, TranslateT("unknown"), SIZEOF(buf)); |