Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
ca8b9219
Commit
ca8b9219
authored
Nov 18, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use vlc_rand_bytes for utf8_mkstemp.
parent
a72e4821
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
src/text/filesystem.c
src/text/filesystem.c
+5
-6
No files found.
src/text/filesystem.c
View file @
ca8b9219
...
...
@@ -31,6 +31,7 @@
#include <vlc_common.h>
#include <vlc_charset.h>
#include "libvlc.h"
/* utf8_mkdir */
#include <vlc_rand.h>
#include <assert.h>
...
...
@@ -451,17 +452,15 @@ int utf8_mkstemp( char *template )
return
-
1
;
}
uint64_t
i_rand
=
mdate
();
/* */
for
(
int
i
=
0
;
i
<
256
;
i
++
)
{
/* Create a pseudo random file name */
uint8_t
pi_rand
[
6
];
vlc_rand_bytes
(
pi_rand
,
sizeof
(
pi_rand
)
);
for
(
int
j
=
0
;
j
<
6
;
j
++
)
{
i_rand
=
i_rand
*
UINT64_C
(
1103515245
)
+
12345
;
psz_rand
[
j
]
=
digits
[((
i_rand
>>
16
)
&
0xffff
)
%
i_digits
];
}
psz_rand
[
j
]
=
digits
[
pi_rand
[
j
]
%
i_digits
];
/* */
int
fd
=
utf8_open
(
template
,
O_CREAT
|
O_EXCL
|
O_RDWR
,
0600
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment