summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-01-24 10:09:41 +0000
committerMike Frysinger <vapier@gentoo.org>2007-01-24 10:09:41 +0000
commit4a38f88b2caeac2faee85fb80606cc9732faa1f7 (patch)
tree5a98226b819227cd7902589bf82794e1b886e096 /libc
parent502f1bc19f336355f88eb25cfbfde36dbd866f24 (diff)
fix from Bryan Wu: return NULL upon error, not the NULL string
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