]> granicus.if.org Git - file/commitdiff
changed assignment to short and long to a memcpy to avoid alignment
authorChristos Zoulas <christos@zoulas.com>
Thu, 23 Sep 1993 18:24:45 +0000 (18:24 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 23 Sep 1993 18:24:45 +0000 (18:24 +0000)
bus errors

src/softmagic.c

index 8b10d06acd73b43796edb7ac211ff6175bd9b25b..e0a67324ee33532777bd0ebbf19e9f7b54591129 100644 (file)
@@ -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: