반응형
char * tmpnam(char *s)
#include <sys/types.h> #include <stdio.h> #include <unistd.h> __warn_references(tmpnam, "warning: tmpnam() possibly used unsafely; consider using mkstemp()"); extern char *_mktemp(char *); char * tmpnam(char *s) { static u_long tmpcount; static char buf[L_tmpnam]; if (s == NULL) s = buf; (void)snprintf(s, L_tmpnam, "%stmp.%lu.XXXXXXXXX", P_tmpdir, tmpcount); ++tmpcount; return (_mktemp(s)); }
반응형