diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-22 22:26:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-22 22:26:25 +0300 |
commit | 23f676163a595018346050eccb5cc8b2571381e6 (patch) | |
tree | 09107aede495a3bebea5bed64a4483ffb3d148e5 /plugins/Dbx_mdbx/src/init.cpp | |
parent | 36b876e544afe74ce5f7463cdf9502d3b23f3ed6 (diff) |
code cleaning
Diffstat (limited to 'plugins/Dbx_mdbx/src/init.cpp')
-rw-r--r-- | plugins/Dbx_mdbx/src/init.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/Dbx_mdbx/src/init.cpp b/plugins/Dbx_mdbx/src/init.cpp index bd73b6e1db..75b5585924 100644 --- a/plugins/Dbx_mdbx/src/init.cpp +++ b/plugins/Dbx_mdbx/src/init.cpp @@ -41,7 +41,7 @@ static PLUGININFOEX pluginInfo = { 0x7c3d0a33, 0x2646, 0x4001, { 0x91, 0x7, 0xf3, 0x5e, 0xa2, 0x99, 0xd2, 0x92 } }
};
-HINSTANCE g_hInst = NULL;
+HINSTANCE g_hInst = nullptr;
LIST<CDbxMDBX> g_Dbs(1, HandleKeySortT);
@@ -69,7 +69,7 @@ static MIDatabase* LoadDatabase(const TCHAR *profile, BOOL bReadOnly) std::unique_ptr<CDbxMDBX> db(new CDbxMDBX(profile, (bReadOnly) ? DBMODE_READONLY : 0));
if (db->Load(false) != ERROR_SUCCESS)
- return NULL;
+ return nullptr;
g_Dbs.insert(db.get());
return db.release();
@@ -87,11 +87,13 @@ MIDatabaseChecker* CheckDb(const TCHAR *profile, int *error) std::unique_ptr<CDbxMDBX> db(new CDbxMDBX(profile, DBMODE_READONLY));
if (db->Load(true) != ERROR_SUCCESS) {
*error = ERROR_ACCESS_DENIED;
- return NULL;
+ return nullptr;
}
- if (db->PrepareCheck(error))
- return NULL;
+ if (db->PrepareCheck()) {
+ *error = ERROR_BAD_FORMAT;
+ return nullptr;
+ }
return db.release();
}
|