From 5130370578fb3526d78fd5424a35fb4a5d4d2e35 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Thu, 23 Sep 1993 18:24:45 +0000 Subject: [PATCH] changed assignment to short and long to a memcpy to avoid alignment bus errors --- src/softmagic.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/softmagic.c b/src/softmagic.c index 8b10d06a..e0a67324 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -34,7 +34,7 @@ #ifndef lint static char *moduleid = - "@(#)$Id: softmagic.c,v 1.18 1993/09/16 21:12:08 christos Exp $"; + "@(#)$Id: softmagic.c,v 1.19 1993/09/23 18:24:45 christos Exp $"; #endif /* lint */ static int match __P((unsigned char *, int)); @@ -247,10 +247,12 @@ int nbytes; case BYTE: v = p->b; break; case SHORT: - v = p->h; break; + memcpy(&v, &p->h, sizeof(short)); + break; case LONG: case DATE: - v = p->l; break; + memcpy(&v, &p->l, sizeof(long)); + break; case STRING: l = 0; /* What we want here is: -- 2.40.0