mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 13:29:03 +02:00
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>
This commit is contained in:
@@ -50,8 +50,7 @@ new_tmp_common(int *fd, char **path, int type)
|
|||||||
#endif
|
#endif
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
char suffix[] =
|
char suffix[] = "tmp.XXXXXXXXXX";
|
||||||
"tmpXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
|
|
||||||
char *tmpdir = NULL;
|
char *tmpdir = NULL;
|
||||||
|
|
||||||
int close_errno;
|
int close_errno;
|
||||||
@@ -582,7 +581,7 @@ mkhtemp(int *fd,
|
|||||||
while (end > template && *--end == 'X')
|
while (end > template && *--end == 'X')
|
||||||
xc++;
|
xc++;
|
||||||
|
|
||||||
if (xc < 12 || xc > len) {
|
if (xc < 6 || xc > len) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user