Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ieee1905
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
ieee1905
Commits
e43f85a5
Commit
e43f85a5
authored
3 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
refactor random seed generation
parent
2dedcf16
No related branches found
No related tags found
No related merge requests found
Pipeline
#35458
passed
3 years ago
Stage: static_code_analysis
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/util.c
+6
-1
6 additions, 1 deletion
src/util.c
with
6 additions
and
1 deletion
src/util.c
+
6
−
1
View file @
e43f85a5
...
...
@@ -91,9 +91,14 @@ int timeradd_msecs(struct timeval *a, unsigned long msecs, struct timeval *res)
void
get_random_bytes
(
int
num
,
uint8_t
*
buf
)
{
unsigned
int
seed
=
(
unsigned
int
)
time
(
NULL
);
unsigned
int
seed
;
struct
timespec
res
=
{
0
};
int
i
;
clock_gettime
(
CLOCK_REALTIME
,
&
res
);
seed
=
res
.
tv_nsec
;
srand
(
seed
);
for
(
i
=
0
;
i
<
num
;
i
++
)
buf
[
i
]
=
rand_r
(
&
seed
)
&
0xff
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment