summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src/init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mdbx/src/init.cpp')
-rw-r--r--plugins/Dbx_mdbx/src/init.cpp12
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();
}