commit: 256208f4afde06008cdd653c89f37f21c4f5586c
parent a6a28b9c714d8e964ab94a7039b82a346c73f8b8
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 8 Mar 2025 06:00:53 +0100
cmd/mktemp: make template & template_copy variables static
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmd/mktemp.c b/cmd/mktemp.c
@@ -78,7 +78,7 @@ int
main(int argc, char *argv[])
{
bool o_create_dir = false, o_quiet = false, o_unsafe = false;
- char template[PATH_MAX] = "tmp.XXXXXXXXXX";
+ static char template[PATH_MAX] = "tmp.XXXXXXXXXX";
const char *tmpdir = NULL;
#ifdef HAS_GETOPT_LONG
@@ -154,7 +154,7 @@ main(int argc, char *argv[])
printf("%s/", tmpdir);
}
- char template_copy[PATH_MAX] = "";
+ static char template_copy[PATH_MAX] = "";
memcpy(template_copy, template, PATH_MAX);
if(o_unsafe) return unsafe_mktemp(template);