From 8ffc77be71507825a8f7585bcabff8ccc370206a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 8 Dec 2018 20:12:16 +0300 Subject: db_get_sa / db_get_wsa to receive the default value, massive code simplification --- plugins/SecureIM/src/commonheaders.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/SecureIM/src/commonheaders.cpp') 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); -- cgit v1.2.3