Message ID | 20181129195800.28483-1-stefan@datenfreihafen.org (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [wpan-tools] hwsim: make sure lqi is always initialized | expand |
Hello. On 29.11.18 20:58, Stefan Schmidt wrote: > The lqi variable was not initialized in all code paths. > > CID: 185497 > > Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> > --- > wpan-hwsim/wpan-hwsim.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/wpan-hwsim/wpan-hwsim.c b/wpan-hwsim/wpan-hwsim.c > index 3e54348..0a7c492 100644 > --- a/wpan-hwsim/wpan-hwsim.c > +++ b/wpan-hwsim/wpan-hwsim.c > @@ -382,7 +382,7 @@ static void print_version(void) > > int main(int argc, const char *argv[]) > { > - unsigned long int idx, idx2, lqi, ignore_idx = ULONG_MAX; > + unsigned long int idx, idx2, lqi = 0, ignore_idx = ULONG_MAX; > bool dot = false; > int cmd; > int rc; > No complains and trivial enough. Applied to wpan-tools master. regards Stefan Schmidt
diff --git a/wpan-hwsim/wpan-hwsim.c b/wpan-hwsim/wpan-hwsim.c index 3e54348..0a7c492 100644 --- a/wpan-hwsim/wpan-hwsim.c +++ b/wpan-hwsim/wpan-hwsim.c @@ -382,7 +382,7 @@ static void print_version(void) int main(int argc, const char *argv[]) { - unsigned long int idx, idx2, lqi, ignore_idx = ULONG_MAX; + unsigned long int idx, idx2, lqi = 0, ignore_idx = ULONG_MAX; bool dot = false; int cmd; int rc;
The lqi variable was not initialized in all code paths. CID: 185497 Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> --- wpan-hwsim/wpan-hwsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)