Diff between acb2de0d82641ace502346ff5672ff7f28f4fccd and 08c45ed6805c09e3d3e4aa3e61898a28460d8fa0

Changed Files

File Additions Deletions Status
tools/btmgmt.c +2 -5 modified

Full Patch

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index 78b9fda..f631de4 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -1037,7 +1037,6 @@ static void commands_rsp(uint8_t status, uint16_t len, const void *param,
 {
 	const struct mgmt_rp_read_commands *rp = param;
 	uint16_t num_commands, num_events;
-	const uint16_t *opcode;
 	size_t expected_len;
 	int i;
 
@@ -1064,17 +1063,15 @@ static void commands_rsp(uint8_t status, uint16_t len, const void *param,
 		goto done;
 	}
 
-	opcode = rp->opcodes;
-
 	print("%u commands:", num_commands);
 	for (i = 0; i < num_commands; i++) {
-		uint16_t op = get_le16(opcode++);
+		uint16_t op = get_le16(rp->opcodes + i);
 		print("\t%s (0x%04x)", mgmt_opstr(op), op);
 	}
 
 	print("%u events:", num_events);
 	for (i = 0; i < num_events; i++) {
-		uint16_t ev = get_le16(opcode++);
+		uint16_t ev = get_le16(rp->opcodes + num_commands + i);
 		print("\t%s (0x%04x)", mgmt_evstr(ev), ev);
 	}