Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
CalendarDataStorage: Convert calendarColour to string before using c_str() in AddCale...
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 17 Jul 2017 19:23:19 +0000 (20:23 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Mon, 17 Jul 2017 19:23:19 +0000 (20:23 +0100)
source/libraries/CalendarDataStorage/CalendarDataStorage.cpp

index d6d335e..5842631 100644 (file)
@@ -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;
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy