don't pass localtime() a pointer into struct timespec (within struct

stat), because there is no guarantee that its tv_sec will be of type
time_t
sigsegv_dump
Greg Alexander 8 years ago
parent 3bc9394101
commit 103812fae8

@ -189,7 +189,8 @@ char *
ls_file(const char *name, const struct stat *st, int remote, int si_units) ls_file(const char *name, const struct stat *st, int remote, int si_units)
{ {
int ulen, glen, sz = 0; int ulen, glen, sz = 0;
struct tm *ltime = localtime(&st->st_mtime); time_t st_time = st->st_mtime;
struct tm *ltime = localtime(&st_time);
char *user, *group; char *user, *group;
char buf[1024], mode[11+1], tbuf[12+1], ubuf[11+1], gbuf[11+1]; char buf[1024], mode[11+1], tbuf[12+1], ubuf[11+1], gbuf[11+1];
char sbuf[FMT_SCALED_STRSIZE]; char sbuf[FMT_SCALED_STRSIZE];

Loading…
Cancel
Save