From e12c811c51fdacb3a73ae8c1b5fa21a2ef0e2157 Mon Sep 17 00:00:00 2001 From: Youssef Hajjioui Date: Fri, 4 Aug 2023 23:16:11 -0400 Subject: [PATCH] Feature request 425 implemented --- src/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.c b/src/utils.c index 2d30bfc9..3ffd78a9 100644 --- a/src/utils.c +++ b/src/utils.c @@ -824,8 +824,8 @@ char *new_tempfile(const char *prefix) if (prefix == NULL) return NULL; - asprintf(&fullname, "%s.XXXXXX", prefix); - if ((fd = mkstemp(fullname)) == -1 + asprintf(&fullname, "%s.XXXXXX.md", prefix); + if ((fd = mkstemps(fullname, 3)) == -1 || (file = fdopen(fd, "w+")) == NULL) { if (fd != -1) { unlink(fullname);