Save xlogfile time_t fields correctly

This commit is contained in:
Pasi Kallinen
2015-03-19 17:41:14 +02:00
parent 02cdaf5a09
commit 3cc3709d95
10 changed files with 25 additions and 16 deletions

View File

@@ -551,13 +551,18 @@ unsigned int *stuckid, *steedid;
amii_setpens(amii_numcolors); /* use colors from save file */
#endif
mread(fd, (genericptr_t) &u, sizeof(struct you));
mread(fd, (genericptr_t) timebuf, 14);
timebuf[14] = '\0';
ubirthday = time_from_yyyymmddhhmmss(timebuf);
#define ReadTimebuf(foo) mread(fd, (genericptr_t) timebuf, 14); \
timebuf[14] = '\0'; \
foo = time_from_yyyymmddhhmmss(timebuf);
ReadTimebuf(ubirthday);
ReadTimebuf(urealtime.realtime);
ReadTimebuf(urealtime.restored);
#if defined(BSD) && !defined(POSIX_TYPES)
(void) time((long *)&u.urealtime.restored);
(void) time((long *)&urealtime.restored);
#else
(void) time(&u.urealtime.restored);
(void) time(&urealtime.restored);
#endif