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