tools: image-host.c: use random instead of rand
PATCH 1/1 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 <[email protected]>
--- tools/image-host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/image-host.c +2 -2
@@ -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++; }
Signature · 1 line
2.17.1
PATCH 1/1 tools: image-host.c: use random instead of rand
Quoted 10 lines · Philippe Reynes
According to the manpage of rand, it is recommended to use random instead of rand. This commit updates the function
get_random_datato use random.Reported-by Coverity (CID: 312953)Signed-off-by Philippe Reynes <[email protected]>--- tools/image-host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by Simon Glass <[email protected]>
PATCH 1/1 tools: image-host.c: use random instead of rand
In reply to Philippe ReynesQuoted 7 lines · Philippe Reynes
According to the manpage of rand, it is recommended to use random instead of rand. This commit updates the function
get_random_datato use random.Reported-by Coverity (CID: 312953)Signed-off-by Philippe Reynes <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201119/8879907c/attachment.sig>