diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-09-12 03:25:43 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-09-12 04:35:24 +0200 |
commit | b2e41cc174e3423282a30fa7c40133350973e300 (patch) | |
tree | 0119e425978bb33d456fe2b51806a459fe91f637 /utils | |
parent | d64b6aed235f6e4d84a2cb8e84b32c3179260254 (diff) |
osmo-auc-gen.c: squelch compiler warnings, move local var
The compiler thinks that ind or ind_mask may be used uninitialized, because it
doesn't analyze the conditionality of command line arguments and other
variables set accordingly. Make the compiler happy by zero initializing.
Change-Id: I9ddcb0525159da520aceaeb6e908a735a003bb5a
Diffstat (limited to 'utils')
-rw-r--r-- | utils/osmo-auc-gen.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index fee97678..1f5c8386 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -98,15 +98,14 @@ int main(int argc, char **argv) struct osmo_auth_vector *vec = &_vec; uint8_t _rand[16], _auts[14]; uint64_t sqn; - unsigned int ind; + unsigned int ind = 0; int rc, option_index; int rand_is_set = 0; int auts_is_set = 0; int sqn_is_set = 0; int ind_is_set = 0; int fmt_triplets_dat = 0; - uint64_t seq_1; - uint64_t ind_mask; + uint64_t ind_mask = 0; printf("osmo-auc-gen (C) 2011-2012 by Harald Welte\n"); printf("This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY\n\n"); @@ -270,7 +269,7 @@ int main(int argc, char **argv) memset(vec, 0, sizeof(*vec)); if (test_aud.type == OSMO_AUTH_TYPE_UMTS) { - seq_1 = 1LL << test_aud.u.umts.ind_bitlen; + uint64_t seq_1 = 1LL << test_aud.u.umts.ind_bitlen; ind_mask = seq_1 - 1; if (sqn_is_set) { |