mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
LibC: Ensure mkstemp generates a pattern 6 characters in length
This commit is contained in:
parent
be73f9f544
commit
b31b666301
Notes:
sideshowbarker
2024-07-19 01:23:14 +09:00
Author: https://github.com/bcoles
Commit: b31b666301
Pull-request: https://github.com/SerenityOS/serenity/pull/4090
1 changed files with 1 additions and 1 deletions
|
@ -186,7 +186,7 @@ __attribute__((warn_unused_result)) int __generate_unique_filename(char* pattern
|
|||
|
||||
for (int attempt = 0; attempt < 100; ++attempt) {
|
||||
for (int i = 0; i < 6; ++i)
|
||||
pattern[start + i] = random_characters[(rand() % sizeof(random_characters))];
|
||||
pattern[start + i] = random_characters[(rand() % (sizeof(random_characters) - 1))];
|
||||
struct stat st;
|
||||
int rc = lstat(pattern, &st);
|
||||
if (rc < 0 && errno == ENOENT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue