diff options
| author | Dan Williams <dcbw@redhat.com> | 2014-08-20 13:59:07 -0500 |
|---|---|---|
| committer | Dan Williams <dcbw@redhat.com> | 2014-08-20 14:18:14 -0500 |
| commit | e7381662fe7b56b4725c10ea4cbd6c0cb455a400 (patch) | |
| tree | 66e9a90f062e902cc18a8153ae078523438b51d0 /libnm-util | |
| parent | b59a82d82ea55ee6b511e7c211572591e570efac (diff) | |
| download | NetworkManager-e7381662fe7b56b4725c10ea4cbd6c0cb455a400.tar.gz | |
trivial: don't shadow rand(3)
Reported by Jordan Messina
(cherry picked from commit 365ca198c0d688e759cd2481d9446ba16f8e78ca)
Diffstat (limited to 'libnm-util')
| -rw-r--r-- | libnm-util/tests/test-general.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c index 468cdf21e8..87e29f5977 100644 --- a/libnm-util/tests/test-general.c +++ b/libnm-util/tests/test-general.c @@ -1830,9 +1830,9 @@ test_ip4_netmask_to_prefix (void) { int i, j; - GRand *rand = g_rand_new (); + GRand *r = g_rand_new (); - g_rand_set_seed (rand, 1); + g_rand_set_seed (r, 1); for (i = 2; i<=32; i++) { guint32 netmask = nm_utils_ip4_prefix_to_netmask (i); @@ -1841,11 +1841,11 @@ test_ip4_netmask_to_prefix (void) g_assert_cmpint (i, ==, nm_utils_ip4_netmask_to_prefix (netmask)); for (j = 0; j < 2*i; j++) { - guint32 r = g_rand_int (rand); + guint32 n = g_rand_int (r); guint32 netmask_holey; guint32 prefix_holey; - netmask_holey = (netmask & r) | netmask_lowest_bit; + netmask_holey = (netmask & n) | netmask_lowest_bit; if (netmask_holey == netmask) continue; @@ -1858,7 +1858,7 @@ test_ip4_netmask_to_prefix (void) } } - g_rand_free (rand); + g_rand_free (r); } #define ASSERT_CHANGED(statement) \ |
