diff options
author | 2014-04-27 23:08:56 +0000 | |
---|---|---|
committer | 2014-04-27 23:08:56 +0000 | |
commit | b770d7afd08231270f0fb23c286e8111f65903ec (patch) | |
tree | 5db4f0429de6112086bbbd8705109bbd625056fa /mandoc.c | |
parent | 9cd87470cdc8d66ea0c03415fc6b2a2bea8e82cb (diff) | |
download | mandoc-b770d7afd08231270f0fb23c286e8111f65903ec.tar.gz mandoc-b770d7afd08231270f0fb23c286e8111f65903ec.tar.zst mandoc-b770d7afd08231270f0fb23c286e8111f65903ec.zip |
Improve error handling in dbopen(). If PRAGMA SQL statements fail,
report the error, close the database, and return failure from dbopen(),
such that the main program can recover and rebuild the database.
As noticed by stsp@, this can happen when database files are
accessible, but corrupt or in the wrong format, which will now
automatically be repaired.
Besides, use a safer idiom after sqlite3_open*() failure that also
handles out-of-memory situations correctly, and do not forget to
close the database after CREATE TABLE failure.
Diffstat (limited to 'mandoc.c')
0 files changed, 0 insertions, 0 deletions