+ snprintf (newdir, ndlen, "%s/%s", parent, ".muttXXXXXX");
+ if (mkdtemp(newdir) == NULL)
newdir is a template arg to mkdtemp(). The directory created by
mkdtemp() is output as the return value. The code should
be:
char *tmpdir;
if ((tmpdir = mkdtemp(newdir)) == NULL)
and tmpdir used instead of newdir below.
mkdtemp() modifies and returns a pointer to its argument upon success:
http://pubs.opengroup.org/onlinepubs/9699919799/
The mkdtemp() function uses the contents of template to construct a unique directory name. The string provided in template shall be a filename ending with six trailing 'X' s. The mkdtemp() function shall replace each 'X' with a character from the portable filename character set.