commit dcacb540dde3405480da29e660adea1b29f5d066
parent fbcc28fad8870439dcd8a038f31dcab05f3e3bc9
Author: René Wagner <rwa@clttr.info>
Date: Wed, 3 Nov 2021 16:54:07 +0100
use return value of tmpnam()
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gmnlm.c b/src/gmnlm.c
@@ -763,7 +763,7 @@ do_prompts(const char *prompt, struct browser *browser)
}
if (url[0]) {
fprintf(browser->tty, "=> %s\n", url);
- char tempfile[] = "/tmp/cgmnlm_XXXXXX";
+ char *tempfile;
if (in[0] == 't') {
struct gemini_response resp;
set_url(browser, url, &browser->history);
@@ -772,7 +772,7 @@ do_prompts(const char *prompt, struct browser *browser)
fprintf(stderr, "Error: %s\n",
gemini_strerr(res, &resp));
} else {
- tmpnam(tempfile);
+ tempfile = tmpnam(NULL);
download_resp(browser->tty, resp, tempfile, url);
}
gemini_response_finish(&resp);