summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1998-03-16 09:21:59 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1998-03-16 09:21:59 +0000
commit6af7e6d6374b7759e88c28d9b93f48c0dee77a08 (patch)
treeb0c9aea88d818703f14fb86b72a6a7e539c1833a /lib/libc
parent6de777acf5a6d13cc8b75e24405fa28b9dbe7d60 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdio/mktemp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c
index 10e43690c175..15b3b09bf927 100644
--- a/lib/libc/stdio/mktemp.c
+++ b/lib/libc/stdio/mktemp.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id: mktemp.c,v 1.4.2.1 1997/04/07 18:03:25 guido Exp $";
+ "$Id: mktemp.c,v 1.4.2.2 1998/03/04 07:26:37 jkh Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -48,7 +48,9 @@ static const char rcsid[] =
#include <ctype.h>
#include <unistd.h>
-static int _gettemp(char *, int *, int);
+char *_mktemp __P((char *));
+
+static int _gettemp __P((char *, int *, int));
int
mkstemp(path)
@@ -66,8 +68,6 @@ mkdtemp(path)
return(_gettemp(path, (int *)NULL, 1) ? path : (char *)NULL);
}
-char *_mktemp(char *);
-
char *
_mktemp(path)
char *path;
@@ -120,13 +120,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 == '/') {