diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2009-09-26 11:16:46 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2009-09-26 11:16:46 +0200 |
commit | 58bb9b8db9141154982c4cbc122802541f9076cd (patch) | |
tree | e8713cb194c1bd5205494f1655bf9a6b900ad24f /database | |
parent | 6ba5a6334ddace1aeec9093f365c28d02d227751 (diff) | |
download | eurephia-58bb9b8db9141154982c4cbc122802541f9076cd.tar.gz eurephia-58bb9b8db9141154982c4cbc122802541f9076cd.tar.xz eurephia-58bb9b8db9141154982c4cbc122802541f9076cd.zip |
Fixed SEGV error when calling sqlite_dump_result() on dbresults from other queries than SELECT
Diffstat (limited to 'database')
-rw-r--r-- | database/sqlite/sqlite.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/database/sqlite/sqlite.c b/database/sqlite/sqlite.c index afe4077..1358a8f 100644 --- a/database/sqlite/sqlite.c +++ b/database/sqlite/sqlite.c @@ -533,8 +533,9 @@ dbresult *sqlite_query_mapped(eurephiaCTX *ctx, SQLqueryType qType, const char * void sqlite_dump_result(FILE *dmp, dbresult *res) { _sqlite_tuples *row = NULL, *field = NULL; - if( res == NULL ) { - fprintf(dmp, "(No records found)"); + if( (res == NULL) || (res->tuples == NULL) ) { + fprintf(dmp, "(No records found)\n"); + return; } /* |