Skip to content

Commit ec1bbcb

Browse files
perimcybersphinx
authored andcommitted
Change savegame date description format to %x %X which is short, descriptive and locale-dependent. Patch by Emdek, closes ticket:2303
(cherry picked from commit e41fa8f)
1 parent eac4ca8 commit ec1bbcb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/loadsave.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ static BOOL _addLoadSave(BOOL bLoad, const char *sSearchPath, const char *sExten
321321
W_BUTTON *button;
322322
char savefile[256];
323323
time_t savetime;
324+
struct tm *timeinfo;
324325

325326
// See if this filename contains the extension we're looking for
326327
if (!strstr(*i, checkExtension))
@@ -336,7 +337,8 @@ static BOOL _addLoadSave(BOOL bLoad, const char *sSearchPath, const char *sExten
336337
/* Figure save-time */
337338
snprintf(savefile, sizeof(savefile), "%s/%s", sSearchPath, *i);
338339
savetime = PHYSFS_getLastModTime(savefile);
339-
sstrcpy(sSlotTips[slotCount], ctime(&savetime));
340+
timeinfo = localtime(&savetime);
341+
strftime(sSlotTips[slotCount], sizeof(sSlotTips[slotCount]), "%x %X", timeinfo);
340342

341343
/* Set the button-text */
342344
(*i)[strlen(*i) - 4] = '\0'; // remove .gam extension

0 commit comments

Comments
 (0)