Fix unaligned access error.

Reviewed by:	ticso
This commit is contained in:
naddy 2002-06-24 12:40:11 +00:00
parent 37cf2222f8
commit 591da72300

View File

@ -231,13 +231,16 @@ int
getwm(p)
caddr_t p;
{
static char buf[INTSIZE];
union {
char buf[INTSIZE];
int i;
} u;
register int i;
for (i = 0; i < INTSIZE; i++)
buf[i] = *p++;
u.buf[i] = *p++;
i = *(int *)buf;
i = u.i;
if (i > MAXPATHLEN || i < -(MAXPATHLEN)) {
i = ntohl(i);