From: Steve Brokenshire Date: Mon, 17 Jul 2017 19:23:19 +0000 (+0100) Subject: CalendarDataStorage: Convert calendarColour to string before using c_str() in AddCale... X-Git-Tag: release-0.04~13 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=3ea0976a82d3e25a44247873f4421fb638c41338;p=xestiacalendar%2F.git CalendarDataStorage: Convert calendarColour to string before using c_str() in AddCalendar() and UpdateCalendar() --- diff --git a/source/libraries/CalendarDataStorage/CalendarDataStorage.cpp b/source/libraries/CalendarDataStorage/CalendarDataStorage.cpp index d6d335e..5842631 100644 --- a/source/libraries/CalendarDataStorage/CalendarDataStorage.cpp +++ b/source/libraries/CalendarDataStorage/CalendarDataStorage.cpp @@ -586,7 +586,8 @@ CDSCalendarResult CalendarDataStorage::AddCalendar(int accountID, string calenda return CDSCALENDAR_FAILED; } - resultCode = sqlite3_bind_text(statementHandle, 4, ((string)calendarColour).c_str(), -1, SQLITE_STATIC); + string calendarColourString = (string)calendarColour; + resultCode = sqlite3_bind_text(statementHandle, 4, calendarColourString.c_str(), -1, SQLITE_STATIC); if (resultCode != 0){ return CDSCALENDAR_FAILED; @@ -858,7 +859,8 @@ CDSCalendarResult CalendarDataStorage::UpdateCalendar(int calendarID, string cal return CDSCALENDAR_FAILED; } - resultCode = sqlite3_bind_text(statementHandle, 2, string(calendarColour).c_str(), -1, SQLITE_STATIC); + string calendarColourString = calendarColour; + resultCode = sqlite3_bind_text(statementHandle, 2, calendarColourString.c_str(), -1, SQLITE_STATIC); if (resultCode != 0){ return CDSCALENDAR_FAILED;