doc = mkd_string (str.c_str(), str.size(), 0);
char tempfile[20];
strcpy (tempfile, "/tmp/biawebXXXXXX");
- mkstemp (tempfile);
- FILE *f = fopen (tempfile, "w");
+ int fd = mkstemp (tempfile);
+ FILE *f = fdopen (fd, "w");
markdown (doc, f, 0);
fclose (f);
std::ifstream ftmp (tempfile);
);
ftmp.close ();
mkd_cleanup (doc);
+ remove (tempfile);
return tmpl;
}