@@ -199,6 +199,8 @@ void CMenuSavesListModel::Update( void )
199
199
{
200
200
save_t save;
201
201
char comment[256 ];
202
+ char time [CS_TIME];
203
+ char date[CS_TIME];
202
204
203
205
// strip path, leave only filename (empty slots doesn't have savename)
204
206
COM_FileBase ( filenames[i], save.name , sizeof ( save.name ));
@@ -220,7 +222,10 @@ void CMenuSavesListModel::Update( void )
220
222
221
223
// they are defined by comment string format
222
224
// time and date
223
- snprintf ( save.date , sizeof ( save.date ), " %s %s" , comment + CS_SIZE, comment + CS_SIZE + CS_TIME );
225
+ Q_strncpy ( time , comment + CS_SIZE, CS_TIME );
226
+ Q_strncpy ( date, comment + CS_SIZE + CS_TIME, CS_TIME );
227
+
228
+ snprintf ( save.date , sizeof ( save.date ), " %s %s" , time , date );
224
229
225
230
// ingame time
226
231
Q_strncpy ( save.elapsed_time , comment + CS_SIZE + CS_TIME * 2 , sizeof ( save.elapsed_time ));
@@ -253,7 +258,7 @@ void CMenuSavesListModel::Update( void )
253
258
Q_strncpy ( s, title, sizeof ( s ));
254
259
255
260
if ( type )
256
- snprintf ( save.comment , sizeof ( save.comment ), " [%s ]%s" , type, L ( s ));
261
+ snprintf ( save.comment , sizeof ( save.comment ), " [%.16s ]%s" , type, L ( s ));
257
262
else Q_strncpy ( save.comment , L ( s ), sizeof ( save.comment ));
258
263
}
259
264
else
0 commit comments