aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/tempnam.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/tempnam.c')
-rw-r--r--stdio-common/tempnam.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/stdio-common/tempnam.c b/stdio-common/tempnam.c
index 14988a8..a86ac08 100644
--- a/stdio-common/tempnam.c
+++ b/stdio-common/tempnam.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
@@ -32,19 +31,20 @@ Cambridge, MA 02139, USA. */
P_tmpdir is tried and finally "/tmp". The storage for the filename
is allocated by `malloc'. */
char *
-DEFUN(tempnam, (dir, pfx), CONST char *dir AND CONST char *pfx)
+tempnam (const char *dir, const char *pfx)
{
+ char buf[FILENAME_MAX];
size_t len;
register char *s;
- register char *t = __stdio_gen_tempname(dir, pfx, 1, &len, (FILE **) NULL);
+ register char *t = __stdio_gen_tempname (buf, sizeof (buf), dir, pfx, 1,
+ &len, (FILE **) NULL);
if (t == NULL)
return NULL;
- s = (char *) malloc(len);
+ s = (char *) malloc (len);
if (s == NULL)
return NULL;
- (void) memcpy(s, t, len);
- return s;
+ return (char *) memcpy (s, t, len);
}