[LTP] [PATCH V3-2 6/9] testcases/lib: Add tst_random decmical integer generator

Cyril Hrubis chrubis@suse.cz
Mon Jun 6 17:46:10 CEST 2016


Hi!
> +static long rand_range(long min, long max)
> +{
> +	return rand() % (max - min + 1) + min;
> +}

I've changed this to use random() and srandom() instead of rand() and
srand(), since rand() and srand() are obsolete and moreover rand()
returns only int while the rest of the test uses long.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list