summaryrefslogtreecommitdiff
path: root/plugins/SecureIM
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-12-08 20:12:16 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-12-08 20:12:26 +0300
commit8ffc77be71507825a8f7585bcabff8ccc370206a (patch)
treeaa13a8070f31286db6ad22e17a577e547942f951 /plugins/SecureIM
parent41b2fdfc654e3eec07c97ceba00cda13d988ffff (diff)
db_get_sa / db_get_wsa to receive the default value, massive code simplification
Diffstat (limited to 'plugins/SecureIM')
-rw-r--r--plugins/SecureIM/src/commonheaders.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp
index f4ad26a11c..98ce15c35f 100644
--- a/plugins/SecureIM/src/commonheaders.cpp
+++ b/plugins/SecureIM/src/commonheaders.cpp
@@ -25,7 +25,9 @@ mir_cs localQueueMutex;
LPSTR myDBGetStringDecode(MCONTACT hContact, const char *szModule, const char *szSetting)
{
char *val = db_get_sa(hContact, szModule, szSetting);
- if (!val) return nullptr;
+ if (!val)
+ return nullptr;
+
size_t len = mir_strlen(val) + 64;
char *buf = (LPSTR)mir_alloc(len);
strncpy(buf, val, len); mir_free(val);