From 89c23755c8ab5d8c5bbbfa6e40eb0c6bda109dad Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Wed, 14 Jul 2021 14:39:31 +0300 Subject: update CVS --- usr.bin/mandoc/term_tag.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'usr.bin/mandoc/term_tag.c') diff --git a/usr.bin/mandoc/term_tag.c b/usr.bin/mandoc/term_tag.c index 86ad01e..2d44650 100644 --- a/usr.bin/mandoc/term_tag.c +++ b/usr.bin/mandoc/term_tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: term_tag.c,v 1.5 2020/07/21 15:08:49 schwarze Exp $ */ +/* $OpenBSD: term_tag.c,v 1.6 2021/02/19 19:49:49 kn Exp $ */ /* * Copyright (c) 2015,2016,2018,2019,2020 Ingo Schwarze * @@ -45,7 +45,8 @@ static struct tag_files tag_files; * but for simplicity, create it anyway. */ 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; int ofd; /* In /tmp/, dup(2)ed to stdout. */ @@ -83,9 +84,9 @@ term_tag_init(const char *outfilename, const char *tagfilename) /* Create both temporary output files. */ if (outfilename == NULL) { - (void)strlcpy(tag_files.ofn, "/tmp/man.XXXXXXXXXX", - sizeof(tag_files.ofn)); - if ((ofd = mkstemp(tag_files.ofn)) == -1) { + (void)snprintf(tag_files.ofn, sizeof(tag_files.ofn), + "/tmp/man.XXXXXXXXXX%s", suffix); + if ((ofd = mkstemps(tag_files.ofn, strlen(suffix))) == -1) { mandoc_msg(MANDOCERR_MKSTEMP, 0, 0, "%s: %s", tag_files.ofn, strerror(errno)); goto fail; -- cgit v1.2.3