- strncpy (tmpfil, m_tmpfil (invo_name), sizeof(tmpfil));
- if ((fp = fopen (tmpfil, "w+")) == NULL)
- padios (tmpfil, "unable to create");
- unlink (tmpfil);
+ char *tfile = m_mktemp2(NULL, invo_name, NULL, &fp);
+ if (tfile == NULL) padios("msh", "unable to create temporary file");
+ unlink(tfile);
+ strncpy(tmpfil, tfile, sizeof(tmpfil));