From 2d0e78e3606e89f11c563e064f0134cdf10d015c Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 17 Apr 2013 15:01:27 +0000 Subject: variety of fixes to correct large time_t code. it is quite broken upstream. ok chl --- usr.bin/file/softmagic.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'usr.bin/file/softmagic.c') 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); -- cgit v1.2.3