summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/stdlib/mkdtemp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libc/stdlib/mkdtemp.c b/libc/stdlib/mkdtemp.c
index 20a2e16bc..fa9ae3b05 100644
--- a/libc/stdlib/mkdtemp.c
+++ b/libc/stdlib/mkdtemp.c
@@ -29,10 +29,9 @@
(This function comes from OpenBSD.) */
char * mkdtemp (char *template)
{
- if (__gen_tempname (template, __GT_DIR))
- /* We return the null string if we can't find a unique file name. */
- template[0] = '\0';
-
+ if (__gen_tempname (template, __GT_DIR))
+ return NULL;
+ else
return template;
}
#endif