Skip to content

Commit

Permalink
zblue: fix build warning
Browse files Browse the repository at this point in the history
Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
  • Loading branch information
Frozen935 committed Jan 13, 2025
1 parent 3d44d6f commit 7a65591
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion port/sections/defines.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,8 @@ const struct settings_handler_static *_settings_handler_static_list[] = {
#endif /* CONFIG_BT_GATT_SERVICE_CHANGED */
#if defined(CONFIG_BT_GATT_CACHING)
&settings_handler_bt_cf,
#endif /* CONFIG_BT_GATT_CACHING */
&settings_handler_bt_hash,
#endif /* CONFIG_BT_GATT_CACHING */
#if defined(CONFIG_BT_DIS)
#if defined(CONFIG_BT_DIS_SETTINGS)
&settings_handler_bt_dis,
Expand Down
2 changes: 1 addition & 1 deletion port/subsys/shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ int main(int argc, char *argv[])
char* _argv[32];
char* buffer = NULL;
char* saveptr;
int ret;
int ret = 0;
size_t len, size = 0;

z_sys_init();
Expand Down
4 changes: 2 additions & 2 deletions subsys/bluetooth/host/classic/br.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,8 +1264,8 @@ int bt_br_write_local_name(const char *name)
}

name_cp = net_buf_add(buf, sizeof(*name_cp));
strncpy((char *)name_cp->local_name, name,
sizeof(name_cp->local_name));
memset(name_cp, 0, sizeof(*name_cp));
memcpy((char *)name_cp->local_name, name, sizeof(name_cp->local_name));

return bt_hci_cmd_send_sync(BT_HCI_OP_WRITE_LOCAL_NAME, buf, NULL);
}
Expand Down
3 changes: 2 additions & 1 deletion subsys/bluetooth/host/classic/ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ static int pin_code_reply(struct bt_conn *conn, const char *pin, uint8_t len)

bt_addr_copy(&cp->bdaddr, &conn->br.dst);
cp->pin_len = len;
strncpy((char *)cp->pin_code, pin, sizeof(cp->pin_code));
memset(cp->pin_code, 0, sizeof(cp->pin_code));
memcpy((char *)cp->pin_code, pin, sizeof(cp->pin_code));

return bt_hci_cmd_send_sync(BT_HCI_OP_PIN_CODE_REPLY, buf, NULL);
}
Expand Down

0 comments on commit 7a65591

Please sign in to comment.