diff options
Diffstat (limited to 'src/lib9/truerand.c')
-rw-r--r-- | src/lib9/truerand.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib9/truerand.c b/src/lib9/truerand.c index 03f3dce1..45f739e1 100644 --- a/src/lib9/truerand.c +++ b/src/lib9/truerand.c @@ -6,6 +6,7 @@ truerand(void) { int i, n; uchar buf[sizeof(ulong)]; + ulong x; static int randfd = -1; static char *randfile; @@ -21,5 +22,6 @@ truerand(void) for(i=0; i<sizeof(buf); i += n) if((n = readn(randfd, buf+i, sizeof(buf)-i)) < 0) sysfatal("can't read %s: %r", randfile); - return *((ulong*)buf); + memmove(&x, buf, sizeof x); + return x; } |