Check integrity of sqlite3 file before decoding or tile-joining

This commit is contained in:
Eric Fischer
2018-03-29 12:02:59 -07:00
parent 3cea1257a5
commit 7f843c4d36
5 changed files with 23 additions and 1 deletions
+6
View File
@@ -274,6 +274,12 @@ void decode(char *fname, int z, unsigned x, unsigned y, std::set<std::string> co
fprintf(stderr, "%s: %s\n", fname, sqlite3_errmsg(db));
exit(EXIT_FAILURE);
}
char *err = NULL;
if (sqlite3_exec(db, "PRAGMA integrity_check;", NULL, NULL, &err) != SQLITE_OK) {
fprintf(stderr, "%s: integrity_check: %s\n", fname, err);
exit(EXIT_FAILURE);
}
}
if (z < 0) {