Commit cc34f04e authored by Philippe Reynes's avatar Philippe Reynes Committed by Tom Rini
Browse files

tools: image-host.c: use random instead of rand



According to the manpage of rand, it is recommended
to use random instead of rand. This commit updates
the function get_random_data to use random.

Reported-by: Coverity (CID: 312953)
Signed-off-by: default avatarPhilippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 5a7885cc
...@@ -339,10 +339,10 @@ static int get_random_data(void *data, int size) ...@@ -339,10 +339,10 @@ static int get_random_data(void *data, int size)
goto out; goto out;
} }
srand(date.tv_nsec); srandom(date.tv_nsec);
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
*tmp = rand() & 0xff; *tmp = random() & 0xff;
tmp++; tmp++;
} }
......
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