Browse Source

random seed buffer must be unsigned

OPENBSD_5_7
deraadt 10 years ago
parent
commit
bb5edfc4b2
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/lib/libc/stdlib/drand48.c

+ 2
- 2
src/lib/libc/stdlib/drand48.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: drand48.c,v 1.4 2014/12/08 21:45:20 deraadt Exp $ */
/* $OpenBSD: drand48.c,v 1.5 2014/12/09 19:50:26 deraadt Exp $ */
/*
* Copyright (c) 1993 Martin Birgmeier
* All rights reserved.
@ -20,7 +20,7 @@ double
drand48(void)
{
if (__rand48_deterministic == 0) {
short rseed[3];
unsigned short rseed[3];
arc4random_buf(rseed, sizeof rseed);
return ldexp((double) rseed[0], -48) +


Loading…
Cancel
Save