From: Philippe Reynes Date: Fri, 13 Nov 2020 15:37:46 +0000 (+0100) Subject: tools: image-host.c: use random instead of rand X-Git-Url: http://git.dujemihanovic.xyz/img/static/gitweb.css?a=commitdiff_plain;h=cc34f04efd63dfdd31ef2dbfd46c15fb485b2888;p=u-boot.git 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 Reviewed-by: Simon Glass --- diff --git a/tools/image-host.c b/tools/image-host.c index 7cef78eab8..5e1dec2338 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -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++; }