From c91528baf87813b1395a3a1ee5d45a88a1e5f47a Mon Sep 17 00:00:00 2001 From: pescuma Date: Thu, 8 May 2008 01:46:36 +0000 Subject: ReplaceVars accept 0 vars git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@93 c086bb3d-8645-0410-b8da-73a8550f86e7 --- Plugins/utils/mir_buffer.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Plugins/utils/mir_buffer.h') diff --git a/Plugins/utils/mir_buffer.h b/Plugins/utils/mir_buffer.h index e4e7385..51398bd 100644 --- a/Plugins/utils/mir_buffer.h +++ b/Plugins/utils/mir_buffer.h @@ -46,19 +46,19 @@ static inline int __bvsnprintf(wchar_t *str, size_t size, const wchar_t } template -static inline int __blen(const T *str) +static inline size_t __blen(const T *str) { return 0; } template<> -static inline int __blen(const char *str) +static inline size_t __blen(const char *str) { return strlen(str); } template<> -static inline int __blen(const wchar_t *str) +static inline size_t __blen(const wchar_t *str) { return lstrlenW(str); } @@ -354,7 +354,7 @@ static void ReplaceVars(Buffer *buffer, HANDLE hContact, TCHAR **variable if (buffer->len < 3) return; - if (numVariables <= 0) + if (numVariables < 0) return; for(size_t i = buffer->len - 1; i > 0; i--) @@ -373,7 +373,7 @@ static void ReplaceVars(Buffer *buffer, HANDLE hContact, TCHAR **variable size_t foundLen = i - j + 1; if (foundLen == 9 && _tcsncmp(&buffer->str[j], _T("%contact%"), 9) == 0) { - buffer->replace(j, i + 1, (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, GCDNF_TCHAR)); + buffer->replace(j, i + 1, (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, GCDNF_TCHAR | GCDNF_NOCACHE)); } else if (foundLen == 6 && _tcsncmp(&buffer->str[j], _T("%date%"), 6) == 0) { -- cgit v1.2.3