From 99660883f075bacb16d7284523a36f8e6c69a665 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 5 Aug 2014 12:50:52 +0000 Subject: 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@. --- test-sqlite3_errstr.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test-sqlite3_errstr.c (limited to 'test-sqlite3_errstr.c') diff --git a/test-sqlite3_errstr.c b/test-sqlite3_errstr.c new file mode 100644 index 00000000..041bf628 --- /dev/null +++ b/test-sqlite3_errstr.c @@ -0,0 +1,8 @@ +#include +#include + +int +main(void) +{ + return(strcmp(sqlite3_errstr(SQLITE_OK), "not an error")); +} -- cgit v1.2.3-56-ge451