summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-04-10 09:54:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-04-10 09:54:20 +0000
commit498668223e938f438c4ef64b097ddc5710ba0a25 (patch)
tree60009e6b4d8c3ceeef7c0349f6cac8561b15c231 /plugins/Db3x_mmap
parentfc3e59bd1f64c437fe74c74e2b30c558665d8c3a (diff)
more accurate way to prevent Chinese in db_get_tstatic
git-svn-id: http://svn.miranda-ng.org/main/trunk@16622 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r--plugins/Db3x_mmap/src/dbsettings.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp
index a1e89cb4d4..c12a0e0d3e 100644
--- a/plugins/Db3x_mmap/src/dbsettings.cpp
+++ b/plugins/Db3x_mmap/src/dbsettings.cpp
@@ -349,10 +349,11 @@ STDMETHODIMP_(BOOL) CDb3Mmap::GetContactSettingStatic(MCONTACT contactID, LPCSTR
if (bNeedsWchars) {
char *pBuf = NEWSTR_ALLOCA(dbv->pszVal);
- if (Utf8toUcs2(pBuf, dbv->cchVal, dbv->pwszVal, cbSaved) < 0)
+ int cbLen = Utf8toUcs2(pBuf, dbv->cchVal, dbv->pwszVal, cbSaved);
+ if (cbLen < 0)
return 1;
- dbv->pwszVal[cbSaved] = 0;
+ dbv->pwszVal[cbLen] = 0;
}
else if (dbv->type == DBVT_UTF8) {
mir_utf8decode(dbv->pszVal, NULL);