diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-08 20:12:16 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-08 20:12:26 +0300 |
commit | 8ffc77be71507825a8f7585bcabff8ccc370206a (patch) | |
tree | aa13a8070f31286db6ad22e17a577e547942f951 /plugins/MyDetails/src/data.cpp | |
parent | 41b2fdfc654e3eec07c97ceba00cda13d988ffff (diff) |
db_get_sa / db_get_wsa to receive the default value, massive code simplification
Diffstat (limited to 'plugins/MyDetails/src/data.cpp')
-rw-r--r-- | plugins/MyDetails/src/data.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 7b8852c657..adb014400f 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -477,18 +477,14 @@ void ProtocolArray::GetDefaultNick() {
ptrW tszNick(g_plugin.getWStringA(SETTING_DEFAULT_NICK));
if (tszNick)
- mir_wstrncpy(default_nick, tszNick, _countof(default_nick));
+ wcsncpy_s(default_nick, tszNick, _TRUNCATE);
else
default_nick[0] = '\0';
}
void ProtocolArray::GetDefaultAvatar()
{
- ptrW tszFile(db_get_wsa(0, "ContactPhoto", "File"));
- if (tszFile)
- mir_wstrncpy(default_avatar_file, tszFile, _countof(default_avatar_file));
- else
- default_avatar_file[0] = '\0';
+ wcsncpy_s(default_avatar_file, ptrW(db_get_wsa(0, "ContactPhoto", "File", L"")), _TRUNCATE);
}
wchar_t *ProtocolArray::GetDefaultStatusMsg()
|