From 7247525fb9893bb2981974b0dedf92e0e42d6734 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 24 Aug 2015 10:00:19 +0200 Subject: [PATCH] fix crash on windows due to incorrect usage of MultiByteToWideChar() --- coreapi/message_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c index a5985f4d3..9f55b3ec1 100644 --- a/coreapi/message_storage.c +++ b/coreapi/message_storage.c @@ -618,7 +618,7 @@ static int _linphone_sqlite3_open(const char *db_file, sqlite3 **db) { #elif defined(_WIN32) int ret; wchar_t db_file_utf16[MAX_PATH_SIZE]; - ret = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, db_file, MAX_PATH_SIZE, db_file_utf16, MAX_PATH_SIZE); + ret = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, db_file, -1, db_file_utf16, MAX_PATH_SIZE); if(ret == 0) db_file_utf16[0] = '\0'; return sqlite3_open16(db_file_utf16, db); #else