diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-04-17 15:01:27 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-04-17 15:01:27 +0000 |
commit | 2d0e78e3606e89f11c563e064f0134cdf10d015c (patch) | |
tree | 294f251259d803799c8aff3ad741c95440799baa /usr.bin/file/softmagic.c | |
parent | 7f71ec3a75cfd4669d2ca0191b19ea88830012e8 (diff) |
variety of fixes to correct large time_t code. it is quite broken upstream.
ok chl
Diffstat (limited to 'usr.bin/file/softmagic.c')
-rw-r--r-- | usr.bin/file/softmagic.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/file/softmagic.c b/usr.bin/file/softmagic.c index cc496d17680..6aa16d2725f 100644 --- a/usr.bin/file/softmagic.c +++ b/usr.bin/file/softmagic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softmagic.c,v 1.16 2010/01/17 20:36:21 chl Exp $ */ +/* $OpenBSD: softmagic.c,v 1.17 2013/04/17 15:01:26 deraadt Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; @@ -425,7 +425,7 @@ mprint(struct magic_set *ms, struct magic *m) case FILE_MEDATE: if (file_printf(ms, MAGIC_DESC, file_fmttime(p->l, 1)) == -1) return -1; - t = ms->offset + sizeof(time_t); + t = ms->offset + sizeof(int32_t); break; case FILE_LDATE: @@ -434,13 +434,13 @@ mprint(struct magic_set *ms, struct magic *m) case FILE_MELDATE: if (file_printf(ms, MAGIC_DESC, file_fmttime(p->l, 0)) == -1) return -1; - t = ms->offset + sizeof(time_t); + t = ms->offset + sizeof(int32_t); break; case FILE_QDATE: case FILE_BEQDATE: case FILE_LEQDATE: - if (file_printf(ms, MAGIC_DESC, file_fmttime((uint32_t)p->q, 1)) + if (file_printf(ms, MAGIC_DESC, file_fmttime(p->q, 1)) == -1) return -1; t = ms->offset + sizeof(uint64_t); @@ -449,7 +449,7 @@ mprint(struct magic_set *ms, struct magic *m) case FILE_QLDATE: case FILE_BEQLDATE: case FILE_LEQLDATE: - if (file_printf(ms, MAGIC_DESC, file_fmttime((uint32_t)p->q, 0)) + if (file_printf(ms, MAGIC_DESC, file_fmttime(p->q, 0)) == -1) return -1; t = ms->offset + sizeof(uint64_t); |