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
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user