Commit 03fe2d0d authored by Alexandre Julliard's avatar Alexandre Julliard

shell32: Use RtlRandom instead of the non-portable rand_r.

parent 8e1b59cb
......@@ -215,7 +215,7 @@ static char *create_trashinfo(const char *info_dir, const char *file_path)
{
const char *base_name;
char *filename_buffer;
unsigned int seed = (unsigned int)time(NULL);
ULONG seed = GetTickCount();
int i;
errno = ENOMEM; /* out-of-memory is the only case when errno isn't set */
......@@ -240,7 +240,7 @@ static char *create_trashinfo(const char *info_dir, const char *file_path)
for (i=0; i<1000; i++)
{
sprintf(filename_buffer, "%s-%08x", base_name, rand_r(&seed));
sprintf(filename_buffer, "%s-%08x", base_name, RtlRandom(&seed));
if (try_create_trashinfo_file(info_dir, filename_buffer, file_path))
return filename_buffer;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment