1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-12 19:22:41 +00:00

DtTerm/TermPrimUtil: Use mkstemp instead of mktemp

This commit is contained in:
Patrick Georgi 2024-01-03 22:51:58 +01:00
parent 9dca44513c
commit e2aa3e665b

View file

@ -412,8 +412,9 @@ _DtTermPrimStartLog(Widget w)
cp = XtMalloc(strlen(tw->term.logFile) + 1); cp = XtMalloc(strlen(tw->term.logFile) + 1);
(void) strcpy(cp, tw->term.logFile); (void) strcpy(cp, tw->term.logFile);
(void) mktemp(cp); int logStream = mkstemp(cp);
if (cp && *cp) { if (logStream != -1) {
tpd->logStream = fdopen(logStream, "w+");
tw->term.logFile = cp; tw->term.logFile = cp;
} else { } else {
(void) XtFree(cp); (void) XtFree(cp);
@ -421,7 +422,7 @@ _DtTermPrimStartLog(Widget w)
} }
} }
if ('|' == *tw->term.logFile ) { else if ('|' == *tw->term.logFile ) {
/* /*
** pipe logfile into command ** pipe logfile into command
*/ */