X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ftempnam.c;h=84f91978019b97836d8aab63f436f1027a19ee6b;hb=e95538fa07d2b460b25ee6c2fef05f820888776d;hp=9bf8c727e718df945e4c7a014ed601c92dbb7fbc;hpb=2fe6579125fe042f2255afbf00fc8e4b80d6a6be;p=musl diff --git a/src/stdio/tempnam.c b/src/stdio/tempnam.c index 9bf8c727..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,10 +32,16 @@ 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