diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2016-09-11 01:14:37 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2016-09-11 14:12:18 +0200 |
commit | e89cef40506d990a982aefedfde7d3ca4f88c524 (patch) | |
tree | f130c65f9e0f83d44157b134027b26723dfcc610 /tests/checkasm | |
parent | 75d642a944d5579e4ef20ff3701422a64692afcf (diff) | |
download | ffmpeg-e89cef40506d990a982aefedfde7d3ca4f88c524.tar.gz |
checkasm: Read the unsigned value as it should
Reading a value larger than int using atoi() may give the wrong result.
Diffstat (limited to 'tests/checkasm')
-rw-r--r-- | tests/checkasm/checkasm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 86d3bab30a..5b4aa640da 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -477,7 +477,8 @@ static void print_cpu_name(void) int main(int argc, char *argv[]) { - int i, seed, ret = 0; + unsigned int seed; + int i, ret = 0; #if ARCH_ARM && HAVE_ARMV5TE_EXTERNAL if (have_vfp(av_get_cpu_flags()) || have_neon(av_get_cpu_flags())) @@ -504,7 +505,7 @@ int main(int argc, char *argv[]) argv++; } - seed = (argc > 1) ? atoi(argv[1]) : av_get_random_seed(); + seed = (argc > 1) ? strtoul(argv[1], NULL, 10) : av_get_random_seed(); fprintf(stderr, "checkasm: using random seed %u\n", seed); av_lfg_init(&checkasm_lfg, seed); |