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
@@ -11,6 +11,12 @@ void enumerate(char *fname) {
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);
}
const char *sql = "SELECT zoom_level, tile_column, tile_row from tiles order by zoom_level, tile_column, tile_row;";
sqlite3_stmt *stmt;