From: deraadt Date: Tue, 22 Jul 2008 21:47:45 +0000 (+0000) Subject: use arc4random_uniform(); ok djm millert X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9cd68eec3a29f75c396b6b60c1d14818a5aba3f3;p=openbsd use arc4random_uniform(); ok djm millert --- diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index 687ec8c7063..a613daea5bf 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mktemp.c,v 1.20 2007/10/21 11:09:30 tobias Exp $ */ +/* $OpenBSD: mktemp.c,v 1.21 2008/07/22 21:47:45 deraadt Exp $ */ /* * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. @@ -109,7 +109,7 @@ _gettemp(char *path, int *doopen, int domkdir, int slen) while (trv >= path && *trv == 'X') { char c; - pid = (arc4random() & 0xffff) % (26+26); + pid = arc4random_uniform(26+26); if (pid < 26) c = pid + 'A'; else