diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-13 20:12:02 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-13 20:12:02 +0000 |
commit | 1ca35422a252e1b254d6a4823717d39f7988514f (patch) | |
tree | d2f6b3486d75cb83a506a27faf4d652cdd686037 /plugins | |
parent | e84bf4a5995b26423129b9339dd387e2a7431a0a (diff) |
fix for wrong CMString::Mid calls
git-svn-id: http://svn.miranda-ng.org/main/trunk@14944 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Dropbox/src/dropbox.cpp | 17 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/smileys.cpp | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp index 2aa36de2d7..6ac4ee8d1b 100644 --- a/plugins/Dropbox/src/dropbox.cpp +++ b/plugins/Dropbox/src/dropbox.cpp @@ -80,17 +80,16 @@ void CDropbox::RequestAccountInfo() JSONNode display_name = root.at("display_name");
if (!display_name.empty())
{
- ptrT display_name(mir_utf8decodeT(display_name.as_string().c_str()));
- TCHAR *sep = _tcsrchr(display_name, _T(' '));
- if (sep)
+ CMString tszDisplayName(display_name.as_mstring());
+ int pos = tszDisplayName.ReverseFind(' ');
+ if (pos != -1)
{
- db_set_ts(hContact, MODULE, "LastName", sep + 1);
- display_name[mir_tstrlen(display_name) - mir_tstrlen(sep)] = '\0';
- db_set_ts(hContact, MODULE, "FirstName", display_name);
+ db_set_ts(hContact, MODULE, "LastName", tszDisplayName.Mid(pos+1));
+ db_set_ts(hContact, MODULE, "FirstName", tszDisplayName.Left(pos));
}
else
{
- db_set_ts(hContact, MODULE, "FirstName", display_name);
+ db_set_ts(hContact, MODULE, "FirstName", tszDisplayName);
db_unset(hContact, MODULE, "LastName");
}
}
@@ -104,8 +103,8 @@ void CDropbox::RequestAccountInfo() db_unset(hContact, MODULE, "Country");
else
{
- char *country = (char *)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, (WPARAM)isocode.c_str(), 0);
- db_set_s(hContact, MODULE, "Country", country);
+ char *szCountry = (char *)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, (WPARAM)isocode.c_str(), 0);
+ db_set_s(hContact, MODULE, "Country", szCountry);
}
}
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 2e3b7febcb..d373dc2190 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -1018,7 +1018,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void) }
if (cppv != cats.GetLength()) {
- displayName = cats.Mid(cppv, cats.GetLength() - cppv);
+ displayName = cats.Mid(cppv);
AddCategory(displayName, displayName, smcCustom, defaultFile);
}
}
|