]> sjero.net Git - linphone/blobdiff - coreapi/message_storage.c
Add strtok in ortp for mingw compilation
[linphone] / coreapi / message_storage.c
index 8ba642b6877aecd0216177f057073b2bb435a248..765543f7a321a29b379e939cf2651197b5cb0544 100644 (file)
@@ -83,7 +83,7 @@ void linphone_sql_request_message(sqlite3 *db,const char *stmt,LinphoneChatRoom
        int ret;\r
        ret=sqlite3_exec(db,stmt,callback,cr,&errmsg);\r
        if(ret != SQLITE_OK) {\r
-               printf("Error in creation: %s.\n", errmsg);\r
+               ms_error("Error in creation: %s.\n", errmsg);\r
                sqlite3_free(errmsg);\r
        }\r
 }\r
@@ -197,20 +197,20 @@ void linphone_create_table(sqlite3* db){
        ret=sqlite3_exec(db,"CREATE TABLE if not exists history (id INTEGER PRIMARY KEY AUTOINCREMENT, localContact TEXT NOT NULL, remoteContact TEXT NOT NULL, direction INTEGER, message TEXT, time TEXT NOT NULL, read INTEGER, status INTEGER);",\r
                0,0,&errmsg);\r
        if(ret != SQLITE_OK) {\r
-               printf("Error in creation: %s.\n", errmsg);\r
+               ms_error("Error in creation: %s.\n", errmsg);\r
                sqlite3_free(errmsg);\r
        }\r
 }\r
 \r
 void linphone_core_message_storage_init(LinphoneCore *lc){\r
        int ret;\r
-       char *errmsg=NULL;\r
+       const char *errmsg;\r
        sqlite3 *db;\r
        ret=sqlite3_open(lc->chat_db_file,&db);\r
        if(ret != SQLITE_OK) {\r
-               printf("Error in the opening: %s.\n", errmsg);\r
+               errmsg=sqlite3_errmsg(db);\r
+               ms_error("Error in the opening: %s.\n", errmsg);\r
                sqlite3_close(db);\r
-               sqlite3_free(errmsg);\r
        }\r
        linphone_create_table(db);\r
        lc->db=db;\r