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

File: [cvsweb.bsd.lv] / mandoc / Attic / test-sqlite3_errstr.c (download)

Revision 1.1, Tue Aug 5 12:50:52 2014 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3, VERSION_1_13_2, 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@.

#include <string.h>
#include <sqlite3.h>

int
main(void)
{
	return(strcmp(sqlite3_errstr(SQLITE_OK), "not an error"));
}