diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-09 20:06:05 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-09 20:06:05 +0000 |
commit | 4e5ef4f9ef22c46caf8909adea31f7e832bb6b7c (patch) | |
tree | c76781e37422e8f1829116be4f0df3cbbea7c5d3 | |
parent | d5d717d422bebddd058522931de4653389861a92 (diff) |
db helpers: replace NULL pointers with empty strings
git-svn-id: http://svn.miranda-ng.org/main/trunk@5300 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | src/mir_core/db.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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);
}
|