version 1.5, 2020/07/21 15:10:01 |
version 1.6, 2021/03/30 17:16:55 |
Line 47 static struct tag_files tag_files; |
|
Line 47 static struct tag_files tag_files; |
|
* but for simplicity, create it anyway. |
* but for simplicity, create it anyway. |
*/ |
*/ |
struct tag_files * |
struct tag_files * |
term_tag_init(const char *outfilename, const char *tagfilename) |
term_tag_init(const char *outfilename, const char *suffix, |
|
const char *tagfilename) |
{ |
{ |
struct sigaction sa; |
struct sigaction sa; |
int ofd; /* In /tmp/, dup(2)ed to stdout. */ |
int ofd; /* In /tmp/, dup(2)ed to stdout. */ |
Line 85 term_tag_init(const char *outfilename, const char *tag |
|
Line 86 term_tag_init(const char *outfilename, const char *tag |
|
/* Create both temporary output files. */ |
/* Create both temporary output files. */ |
|
|
if (outfilename == NULL) { |
if (outfilename == NULL) { |
(void)strlcpy(tag_files.ofn, "/tmp/man.XXXXXXXXXX", |
(void)snprintf(tag_files.ofn, sizeof(tag_files.ofn), |
sizeof(tag_files.ofn)); |
"/tmp/man.XXXXXXXXXX%s", suffix); |
if ((ofd = mkstemp(tag_files.ofn)) == -1) { |
if ((ofd = mkstemps(tag_files.ofn, strlen(suffix))) == -1) { |
mandoc_msg(MANDOCERR_MKSTEMP, 0, 0, |
mandoc_msg(MANDOCERR_MKSTEMP, 0, 0, |
"%s: %s", tag_files.ofn, strerror(errno)); |
"%s: %s", tag_files.ofn, strerror(errno)); |
goto fail; |
goto fail; |