summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/mktemp.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1998-03-04 02:34:49 +0000
committerderaadt <deraadt@openbsd.org>1998-03-04 02:34:49 +0000
commitca2d163723269841f8aeb4ec50170681abb3e43c (patch)
tree75f50440ed9352e0456cfcf3165e504c18f2d6b6 /lib/libc/stdio/mktemp.c
parentTypos... (diff)
downloadwireguard-openbsd-ca2d163723269841f8aeb4ec50170681abb3e43c.tar.xz
wireguard-openbsd-ca2d163723269841f8aeb4ec50170681abb3e43c.zip
uninitialized case; bde
Diffstat (limited to 'lib/libc/stdio/mktemp.c')
-rw-r--r--lib/libc/stdio/mktemp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c
index d54deceb503..f4e5e0f29fa 100644
--- a/lib/libc/stdio/mktemp.c
+++ b/lib/libc/stdio/mktemp.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: mktemp.c,v 1.10 1997/10/07 22:21:34 millert Exp $";
+static char rcsid[] = "$OpenBSD: mktemp.c,v 1.11 1998/03/04 02:34:49 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -115,13 +115,14 @@ _gettemp(path, doopen, domkdir)
c = (pid - 26) + 'a';
*trv-- = c;
}
+ start = trv + 1;
/*
* check the target directory; if you have six X's and it
* doesn't exist this runs for a *very* long time.
*/
if (doopen || domkdir) {
- for (start = trv + 1;; --trv) {
+ for (;; --trv) {
if (trv <= path)
break;
if (*trv == '/') {