botched raw() calls no longer DOS

This commit is contained in:
anon 2023-08-03 15:49:45 +02:00
parent d158b9c863
commit add94130bd

View File

@ -21,13 +21,6 @@
} \
} while (0)
#define DBUSERERR(line) do { \
const int e = line; \
if(e != SQLITE_OK && e != SQLITE_ROW && e != SQLITE_DONE) { \
r = sqlite3_errmsg(connection); \
} \
} while(0)
static sqlite3 * connection = NULL;
DECL int
@ -129,7 +122,7 @@ raw(const char * const sql)
{
char* errmsg;
char *r = (char*)calloc(sizeof(char), 10000); // TODO: allow for reallocing in rtos, start with a smaller value
DBUSERERR(sqlite3_exec(connection, sql, rtos, &r, &errmsg));
sqlite3_exec(connection, sql, rtos, &r, &errmsg);
if (errmsg){
free(r);
r = errmsg;