Skip to content

Commit

Permalink
NULL-terminated sqlite3_prepare_v2 call
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-mausch committed Apr 11, 2014
1 parent d79b5a5 commit ff8683b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions source/WhatsApp/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ WhatsappDatabase::~WhatsappDatabase()
void WhatsappDatabase::getChats(std::vector<WhatsappChat*> &chats)
{
sqlite3_stmt *res;
const char *tail;
int error = sqlite3_prepare_v2(sqLiteDatabase,
"SELECT * FROM chat_list",
1000, &res, &tail);
int error = sqlite3_prepare_v2(sqLiteDatabase, "SELECT * FROM chat_list", -1, &res, NULL);

if (error != SQLITE_OK)
{
Expand All @@ -63,8 +60,7 @@ void WhatsappDatabase::getMessages(const std::string &chatId, std::vector<Whatsa
query << "SELECT * FROM messages where key_remote_jid = '" << chatId << "' order by timestamp asc";

sqlite3_stmt *res;
const char *tail;
int error = sqlite3_prepare_v2(sqLiteDatabase, query.str().c_str(), 1000, &res, &tail);
int error = sqlite3_prepare_v2(sqLiteDatabase, query.str().c_str(), -1, &res, NULL);

if (error != SQLITE_OK)
{
Expand Down

0 comments on commit ff8683b

Please sign in to comment.