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/SecureIM/src | |
parent | 41b2fdfc654e3eec07c97ceba00cda13d988ffff (diff) |
db_get_sa / db_get_wsa to receive the default value, massive code simplification
Diffstat (limited to 'plugins/SecureIM/src')
-rw-r--r-- | plugins/SecureIM/src/commonheaders.cpp | 4 |
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);
|