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
2088dce6
Commit
2088dce6
authored
Sep 01, 2007
by
Christophe Mutricy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rand_s() is only in Win XP and latest. so use rand() until we decide to not support win2000
parent
53b2aa83
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
src/misc/rand.c
src/misc/rand.c
+6
-2
No files found.
src/misc/rand.c
View file @
2088dce6
...
...
@@ -116,7 +116,9 @@ void vlc_rand_bytes (void *buf, size_t len)
}
#else
/* WIN32 */
#define _CRT_RAND_S
/* It would be better to use rand_s() instead of rand() but it's not possible
* while we support Win 2OOO and until it gets included in mingw */
/* #define _CRT_RAND_S*/
#include <stdlib.h>
void
vlc_rand_bytes
(
void
*
buf
,
size_t
len
)
...
...
@@ -124,7 +126,8 @@ void vlc_rand_bytes (void *buf, size_t len)
while
(
len
>
0
)
{
unsigned
int
val
;
rand_s
(
&
val
);
/*rand_s (&val);*/
val
=
rand
();
if
(
len
<
sizeof
(
val
))
{
...
...
@@ -133,6 +136,7 @@ void vlc_rand_bytes (void *buf, size_t len)
}
memcpy
(
buf
,
&
val
,
sizeof
(
val
));
len
-=
sizeof
(
val
);
}
}
#endif
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