1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix compilation with GCC7

This commit is contained in:
Michał Janiszewski
2017-04-24 11:34:56 +02:00
committed by Michael Steenbeek
parent a16220ef82
commit 92aefb477f
3 changed files with 11 additions and 11 deletions

View File

@@ -1043,10 +1043,10 @@ void game_autosave()
rct2_time currentTime;
platform_get_time_local(&currentTime);
utf8 timeName[34];
snprintf(timeName, 34, "autosave_%d-%02d-%02d_%02d-%02d-%02d%s",
currentDate.year, currentDate.month, currentDate.day, currentTime.hour, currentTime.minute,currentTime.second,
fileExtension);
utf8 timeName[44];
snprintf(timeName, sizeof(timeName), "autosave_%04u-%02u-%02u_%02u-%02u-%02u%s",
currentDate.year, currentDate.month, currentDate.day, currentTime.hour,
currentTime.minute, currentTime.second, fileExtension);
limit_autosave_count(NUMBER_OF_AUTOSAVES_TO_KEEP);

View File

@@ -74,16 +74,16 @@ typedef struct file_info {
} file_info;
typedef struct rct2_date {
sint16 day;
sint16 month;
uint8 day;
uint8 month;
sint16 year;
sint16 day_of_week;
uint8 day_of_week;
} rct2_date;
typedef struct rct2_time {
sint16 hour;
sint16 minute;
sint16 second;
uint8 hour;
uint8 minute;
uint8 second;
} rct2_time;
typedef struct openrct2_cursor {

View File

@@ -482,7 +482,7 @@ private:
// Check if there are spare entries available
size_t maxEntries = (size_t)object_entry_group_counts[objectType];
if (entries->GetCount() < maxEntries)
if (entries != nullptr && entries->GetCount() < maxEntries)
{
entries->GetOrAddEntry(objectName);
}