diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-27 15:33:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-27 15:33:58 +0000 |
commit | df77e258df8cec689a001ec92031538298661b1b (patch) | |
tree | 56ec236ca9675f049c4806e8d41986c40b537f07 /plugins/Db3x_mmap/src/dbheaders.cpp | |
parent | 414ffc78d69f09d48fc43051e0806a30e8fb5c67 (diff) |
merge of dbtool & database plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@1213 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbheaders.cpp')
-rw-r--r-- | plugins/Db3x_mmap/src/dbheaders.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/Db3x_mmap/src/dbheaders.cpp b/plugins/Db3x_mmap/src/dbheaders.cpp index 394b66acfc..68e7da15e1 100644 --- a/plugins/Db3x_mmap/src/dbheaders.cpp +++ b/plugins/Db3x_mmap/src/dbheaders.cpp @@ -58,8 +58,14 @@ int CDb3Base::CreateDbHeaders() int CDb3Base::CheckDbHeaders()
{
- if (memcmp(m_dbHeader.signature, &dbSignature, sizeof(m_dbHeader.signature))) return 1;
- if (m_dbHeader.version != DB_THIS_VERSION) return 2;
- if (m_dbHeader.ofsUser == 0) return 3;
+ if (memcmp(m_dbHeader.signature, &dbSignature, sizeof(m_dbHeader.signature)))
+ return EGROKPRF_UNKHEADER;
+
+ if (m_dbHeader.version != DB_THIS_VERSION)
+ return EGROKPRF_VERNEWER;
+
+ if (m_dbHeader.ofsUser == 0)
+ return EGROKPRF_DAMAGED;
+
return 0;
}
|