I noticed this with CGT
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
const char *mkdtemp(char pattern[])
{
/* The pattern MUST end with six X's */
char *start;
if ((start = strstr(pattern, "XXXXXX")) == NULL || *(start+6) != '\0')
{
errno = EINVAL;
return NULL;
}
/*-----------------------------------------------------------------------*/
/* This algorithm is weak, but better than nothing. We don't expect */
/* expect much danger from collisions (fingers crossed). Hopefully */
/* we'll get a real version of mkdtemp eventually. */
/*-----------------------------------------------------------------------*/
srand(time(NULL));
for (int attempt = 0; attempt
now it works!