better unique file names
Our mktemp(1) implementation uses 8-X for a temp file by default. That's ok, but we should increase the value from 8 to 10 as many other OS already did. PR: 261438
This commit is contained in:
parent
39a36707bd
commit
98839c40c7
@ -97,9 +97,9 @@ main(int argc, char **argv)
|
|||||||
if (tflag) {
|
if (tflag) {
|
||||||
tmpdir = getenv("TMPDIR");
|
tmpdir = getenv("TMPDIR");
|
||||||
if (tmpdir == NULL)
|
if (tmpdir == NULL)
|
||||||
asprintf(&name, "%s%s.XXXXXXXX", _PATH_TMP, prefix);
|
asprintf(&name, "%s%s.XXXXXXXXXX", _PATH_TMP, prefix);
|
||||||
else
|
else
|
||||||
asprintf(&name, "%s/%s.XXXXXXXX", tmpdir, prefix);
|
asprintf(&name, "%s/%s.XXXXXXXXXX", tmpdir, prefix);
|
||||||
/* if this fails, the program is in big trouble already */
|
/* if this fails, the program is in big trouble already */
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
if (qflag)
|
if (qflag)
|
||||||
|
Loading…
Reference in New Issue
Block a user