X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ftempnam.c;h=84f91978019b97836d8aab63f436f1027a19ee6b;hb=e95538fa07d2b460b25ee6c2fef05f820888776d;hp=45a5f266100db36970b528fadbd1ffac710f9cf8;hpb=dd5f50da6f6c3df5647e922e47f8568a8896a752;p=musl diff --git a/src/stdio/tempnam.c b/src/stdio/tempnam.c index 45a5f266..84f91978 100644 --- a/src/stdio/tempnam.c +++ b/src/stdio/tempnam.c @@ -4,12 +4,11 @@ #include #include #include +#include #include "syscall.h" #define MAXTRIES 100 -char *__randname(char *); - char *tempnam(const char *dir, const char *pfx) { char s[PATH_MAX]; @@ -33,6 +32,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