summaryrefslogtreecommitdiff
path: root/openbsd-compat/mktemp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-09-11 10:29:11 +1000
committerDamien Miller <djm@mindrot.org>2002-09-11 10:29:11 +1000
commit71eb0c1550ec6ad10d29779df7a7f97c44000e3a (patch)
tree1cbfd081547bcf3bfcc26e17f2f4537a03ced5ff /openbsd-compat/mktemp.c
parentc34e03e4711cabffae3504bcfdac26b67250c45d (diff)
downloadopenssh-git-71eb0c1550ec6ad10d29779df7a7f97c44000e3a.tar.gz
- (djm) Sync openbsd-compat with OpenBSD -current
Diffstat (limited to 'openbsd-compat/mktemp.c')
-rw-r--r--openbsd-compat/mktemp.c6
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);