summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stdio/tempnam.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stdio/tempnam.c b/src/stdio/tempnam.c
index 45a5f266..5a559752 100644
--- a/src/stdio/tempnam.c
+++ b/src/stdio/tempnam.c
@@ -33,6 +33,7 @@ char *tempnam(const char *dir, const char *pfx)
s[dl] = '/';
memcpy(s+dl+1, pfx, pl);
s[dl+1+pl] = '_';
+ s[l] = 0;
for (try=0; try<MAXTRIES; try++) {
__randname(s+l-6);