summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/mktemp.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-08-25 10:24:39 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-08-25 10:24:39 +0000
commitb6f73e51f51cd9c550fce169b58fe8090b13941b (patch)
treef032190a24afd12be68a6f63a4f29ca558afcc65 /libc/stdlib/mktemp.c
parent1e4616de20f7ba07cf490499b4291d8e6c3cc054 (diff)
downloaduClibc-alpine-b6f73e51f51cd9c550fce169b58fe8090b13941b.tar.bz2
uClibc-alpine-b6f73e51f51cd9c550fce169b58fe8090b13941b.tar.xz
Sync with trunk.
Diffstat (limited to 'libc/stdlib/mktemp.c')
-rw-r--r--libc/stdlib/mktemp.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libc/stdlib/mktemp.c b/libc/stdlib/mktemp.c
index 57f9398b3..f3af1c15c 100644
--- a/libc/stdlib/mktemp.c
+++ b/libc/stdlib/mktemp.c
@@ -21,13 +21,15 @@
#include "../misc/internals/tempname.h"
/* Generate a unique temporary file name from TEMPLATE.
- The last six characters of TEMPLATE must be "XXXXXX";
- they are replaced with a string that makes the filename unique. */
-char * mktemp (char *template)
+ * The last six characters of TEMPLATE must be "XXXXXX";
+ * they are replaced with a string that makes the filename unique. */
+char *mktemp(char *template)
{
- if (__gen_tempname (template, __GT_NOCREATE) < 0)
- /* We return the null string if we can't find a unique file name. */
- template[0] = '\0';
+ if (__gen_tempname (template, __GT_NOCREATE) < 0)
+ /* We return the null string if we can't find a unique file name. */
+ template[0] = '\0';
- return template;
+ return template;
}
+
+link_warning(mktemp, "the use of `mktemp' is dangerous, better use `mkstemp'")