Skip to content

bluetooth: shell: Uninitialized scalar variables #10738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions subsys/bluetooth/shell/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,8 @@ static const struct bt_data ad_discov[] = {
static int cmd_advertise(const struct shell *shell, size_t argc, char *argv[])
{
struct bt_le_adv_param param;
const struct bt_data *ad, *scan_rsp;
size_t ad_len, scan_rsp_len;
const struct bt_data *ad;
size_t ad_len;
int err;

err = shell_cmd_precheck(shell, (argc >= 2), NULL, 0);
Expand Down Expand Up @@ -689,8 +689,6 @@ static int cmd_advertise(const struct shell *shell, size_t argc, char *argv[])
param.options = BT_LE_ADV_OPT_USE_NAME;
} else if (!strcmp(argv[1], "nconn")) {
param.options = 0;
scan_rsp = NULL;
scan_rsp_len = 0;
} else {
goto fail;
}
Expand All @@ -713,7 +711,7 @@ static int cmd_advertise(const struct shell *shell, size_t argc, char *argv[])
ad_len = ARRAY_SIZE(ad_discov);
}

err = bt_le_adv_start(&param, ad, ad_len, scan_rsp, scan_rsp_len);
err = bt_le_adv_start(&param, ad, ad_len, NULL, 0);
if (err < 0) {
error(shell, "Failed to start advertising (err %d)",
err);
Expand Down Expand Up @@ -1011,7 +1009,7 @@ static int cmd_clear(const struct shell *shell, size_t argc, char *argv[])

static int cmd_chan_map(const struct shell *shell, size_t argc, char *argv[])
{
u8_t chan_map[5];
u8_t chan_map[5] = {};
int err;

err = shell_cmd_precheck(shell, (argc == 2), NULL, 0);
Expand Down