From 4e5ef4f9ef22c46caf8909adea31f7e832bb6b7c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 9 Jul 2013 20:06:05 +0000 Subject: db helpers: replace NULL pointers with empty strings git-svn-id: http://svn.miranda-ng.org/main/trunk@5300 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/db.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mir_core/db.cpp') diff --git a/src/mir_core/db.cpp b/src/mir_core/db.cpp index f665899073..6b066e1af8 100644 --- a/src/mir_core/db.cpp +++ b/src/mir_core/db.cpp @@ -186,7 +186,7 @@ MIR_CORE_DLL(INT_PTR) db_set_s(HANDLE hContact, const char *szModule, const char cws.szModule = szModule; cws.szSetting = szSetting; cws.value.type = DBVT_ASCIIZ; - cws.value.pszVal = (char*)val; + cws.value.pszVal = (char*)(val == NULL ? "" : val); return currDb->WriteContactSetting(hContact, &cws); } @@ -198,7 +198,7 @@ MIR_CORE_DLL(INT_PTR) db_set_ws(HANDLE hContact, const char *szModule, const cha cws.szModule = szModule; cws.szSetting = szSetting; cws.value.type = DBVT_WCHAR; - cws.value.pwszVal = (WCHAR*)val; + cws.value.pwszVal = (WCHAR*)(val == NULL ? L"" : val); return currDb->WriteContactSetting(hContact, &cws); } @@ -210,7 +210,7 @@ MIR_CORE_DLL(INT_PTR) db_set_utf(HANDLE hContact, const char *szModule, const ch cws.szModule = szModule; cws.szSetting = szSetting; cws.value.type = DBVT_UTF8; - cws.value.pszVal = (char*)val; + cws.value.pszVal = (char*)(val == NULL ? "" : val); return currDb->WriteContactSetting(hContact, &cws); } -- cgit v1.2.3