mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 19:34:35 +00:00
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: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5a7885cca5
commit
cc34f04efd
1 changed files with 2 additions and 2 deletions
|
@ -339,10 +339,10 @@ static int get_random_data(void *data, int size)
|
|||
goto out;
|
||||
}
|
||||
|
||||
srand(date.tv_nsec);
|
||||
srandom(date.tv_nsec);
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
*tmp = rand() & 0xff;
|
||||
*tmp = random() & 0xff;
|
||||
tmp++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue