From bb118af7af2998e783c7d4eee3a873b19ef532f1 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sat, 12 Oct 1996 12:25:02 +0000 Subject: [PATCH] (sumFile): consider the case that `res' is not longword-aligned. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@842 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/rnd_keys.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/des/rnd_keys.c b/lib/des/rnd_keys.c index 3ad25bb4f..4ff29902e 100644 --- a/lib/des/rnd_keys.c +++ b/lib/des/rnd_keys.c @@ -30,10 +30,10 @@ RCSID("$Id$"); */ static int -sumFile (const char *name, int len, void *sum_) +sumFile (const char *name, int len, void *res) { - int32_t *sum = sum_; - int32_t buf[1024*2]; + u_int32_t sum[2]; + u_int32_t buf[1024*2]; int fd, i; fd = open (name, 0); @@ -57,6 +57,7 @@ sumFile (const char *name, int len, void *sum_) len -= n; } close (fd); + memcpy (res, &sum, sizeof(sum)); return 0; }