summaryrefslogtreecommitdiff
path: root/util/libreboot-utils
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-24 01:32:59 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-24 01:51:59 +0000
commita5eed39a76e257e4a257ddce89a1bff3618fc12a (patch)
tree61183a97526075deeac177840c1b75d43b59ae80 /util/libreboot-utils
parentf2544d094ba88e1cfbb7993ad67444852cfd5efd (diff)
lib/mkhtemp.c: use standard suffix
it may seem counterintuitive that a shorter suffix is better, but i think we should ideally look just like what is made my any other tool, and other mktemp tools generate: tmp.XXXXXXXXXX this is the default, but of course it could be changed. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils')
-rw-r--r--util/libreboot-utils/lib/mkhtemp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/util/libreboot-utils/lib/mkhtemp.c b/util/libreboot-utils/lib/mkhtemp.c
index 7c2f1fde..8d58dcc5 100644
--- a/util/libreboot-utils/lib/mkhtemp.c
+++ b/util/libreboot-utils/lib/mkhtemp.c
@@ -50,8 +50,7 @@ new_tmp_common(int *fd, char **path, int type)
#endif
struct stat st;
- char suffix[] =
- "tmpXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+ char suffix[] = "tmp.XXXXXXXXXX";
char *tmpdir = NULL;
int close_errno;
@@ -582,7 +581,7 @@ mkhtemp(int *fd,
while (end > template && *--end == 'X')
xc++;
- if (xc < 12 || xc > len) {
+ if (xc < 6 || xc > len) {
errno = EINVAL;
return -1;
}