From b2e41cc174e3423282a30fa7c40133350973e300 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 12 Sep 2017 03:25:43 +0200 Subject: 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 --- utils/osmo-auc-gen.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'utils') 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) { -- cgit v1.2.3