Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
345d466c
Commit
345d466c
authored
Sep 03, 2007
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
misc/rand.c: cleanup and fix a stupid bug
parent
99e59bbe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
src/misc/rand.c
src/misc/rand.c
+18
-16
No files found.
src/misc/rand.c
View file @
345d466c
...
...
@@ -123,6 +123,7 @@ void vlc_rand_bytes (void *buf, size_t len)
{
HCRYPTPROV
hProv
;
size_t
count
=
len
;
uint8_t
*
p_buf
=
(
uint8_t
*
)
buf
;
/* fill buffer with pseudo-random data */
while
(
count
>
0
)
...
...
@@ -131,12 +132,13 @@ void vlc_rand_bytes (void *buf, size_t len)
val
=
rand
();
if
(
count
<
sizeof
(
val
))
{
memcpy
(
buf
,
&
val
,
count
);
memcpy
(
p_
buf
,
&
val
,
count
);
break
;
}
memcpy
(
buf
,
&
val
,
sizeof
(
val
));
memcpy
(
p_
buf
,
&
val
,
sizeof
(
val
));
count
-=
sizeof
(
val
);
p_buf
+=
sizeof
(
val
);
}
/* acquire default encryption context */
...
...
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