diff options
author | Damien Miller <djm@mindrot.org> | 2002-09-11 10:29:11 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-09-11 10:29:11 +1000 |
commit | 71eb0c1550ec6ad10d29779df7a7f97c44000e3a (patch) | |
tree | 1cbfd081547bcf3bfcc26e17f2f4537a03ced5ff /openbsd-compat/mktemp.c | |
parent | c34e03e4711cabffae3504bcfdac26b67250c45d (diff) |
- (djm) Sync openbsd-compat with OpenBSD -current
Diffstat (limited to 'openbsd-compat/mktemp.c')
-rw-r--r-- | openbsd-compat/mktemp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index d69dc5c2..d256ee44 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c @@ -39,7 +39,7 @@ #ifndef HAVE_MKDTEMP #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: mktemp.c,v 1.14 2002/01/02 20:18:32 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: mktemp.c,v 1.16 2002/05/27 18:20:45 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #ifdef HAVE_CYGWIN @@ -102,11 +102,11 @@ _gettemp(path, doopen, domkdir, slen) return (0); } pid = getpid(); - while (*trv == 'X' && pid != 0) { + while (trv >= path && *trv == 'X' && pid != 0) { *trv-- = (pid % 10) + '0'; pid /= 10; } - while (*trv == 'X') { + while (trv >= path && *trv == 'X') { char c; pid = (arc4random() & 0xffff) % (26+26); |