From 85ff7204cc8490e6baa3f7dc59a85dfa65bd0838 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 26 Mar 2000 19:46:45 +0000 Subject: [PATCH] make sure to always call time, ctime, and gmtime with `time_t's. there were some types (like in lastlog) that we believed to always be time_t. this has proven wrong on Solaris 8 in 64-bit mode, where they are stored as 32-bit quantities but time_t has gone up to 64 bits git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8066 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftp/cmds.c | 3 ++- appl/ftp/ftpd/ftpcmd.y | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/appl/ftp/ftp/cmds.c b/appl/ftp/ftp/cmds.c index 8040b07b8..b7ac1110c 100644 --- a/appl/ftp/ftp/cmds.c +++ b/appl/ftp/ftp/cmds.c @@ -647,6 +647,7 @@ getit(int argc, char **argv, int restartit, char *mode) int cmdret; int yy, mo, day, hour, min, sec; struct tm *tm; + time_t st_mtime = stbuf.st_mtime; overbose = verbose; if (debug == 0) @@ -665,7 +666,7 @@ getit(int argc, char **argv, int restartit, char *mode) return (0); } - tm = gmtime(&stbuf.st_mtime); + tm = gmtime(&st_mtime); tm->tm_mon++; tm->tm_year += 1900; diff --git a/appl/ftp/ftpd/ftpcmd.y b/appl/ftp/ftpd/ftpcmd.y index b4fe9535f..284884258 100644 --- a/appl/ftp/ftpd/ftpcmd.y +++ b/appl/ftp/ftpd/ftpcmd.y @@ -620,7 +620,9 @@ cmd "%s: not a plain file.", $3); } else { struct tm *t; - t = gmtime(&stbuf.st_mtime); + time_t st_mtime = stbuf.st_mtime; + + t = gmtime(&st_mtime); reply(213, "%04d%02d%02d%02d%02d%02d", t->tm_year + 1900,