summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Dropbox/src/dropbox.cpp17
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp2
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);
}
}