[BACK]Return to compat_sqlite3_errstr.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

File: [cvsweb.bsd.lv] / mandoc / Attic / compat_sqlite3_errstr.c (download)

Revision 1.1, Tue Aug 5 12:50:52 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1

Since old SQLite versions do not have sqlite3_errstr(),
provide a dummy fallback implementation.
Do not bother to decode the error, SQLite error codes
are not useful enough for that to be worthwhile.
Note that using sqlite3_errmsg(db) would be a bad idea:
On malloc() failure, db is NULL, which would cause a segfault.
Issue noticed by kristaps@.

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifdef HAVE_SQLITE3_ERRSTR

int dummy;

#else

const char *
sqlite3_errstr(int rc)
{

	return(rc ? "unknown error" : "not an error");
}

#endif