Skip to content

Commit 1945d37

Browse files
committed
feature_test: Use proper size values for memset() and memcpy()
Some size fields previously used sizeof() with a pointer, which is clearly not right. Use the proper value.
1 parent e92fa66 commit 1945d37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

host_test/feature_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,13 @@ static int write_and_read(libusb_device_handle *handle, const unsigned char *buf
181181
if (res)
182182
return res;
183183

184-
memset(work_buf, 0xaa, sizeof(buf));
184+
memset(work_buf, 0xaa, sizeof(work_buf));
185185

186186
res = read_ep(handle, work_buf, len, expected_failure & READ_SHOULD_FAIL);
187187
if (res)
188188
return res;
189189

190-
if (memcmp(buf, work_buf, sizeof(buf))) {
190+
if (memcmp(buf, work_buf, len)) {
191191
printf("Data received is not correct\n");
192192
return -1;
193193
}

0 commit comments

Comments
 (0)