From e78c9199f3e64722b422088627cfd89d0a1dd5cf 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@. --- config.h.post | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config.h.post') diff --git a/config.h.post b/config.h.post index 07b53415..e95f5f53 100644 --- a/config.h.post +++ b/config.h.post @@ -23,6 +23,9 @@ extern char *suboptarg; #ifndef HAVE_REALLOCARRAY extern void *reallocarray(void *, size_t, size_t); #endif +#ifndef HAVE_SQLITE3_ERRSTR +extern const char *sqlite3_errstr(int); +#endif #ifndef HAVE_STRCASESTR extern char *strcasestr(const char *, const char *); #endif -- cgit