Skip to content
Browse files

test/bluetooth: sizeof() is not strlen()

sizeof(value) returns the size of the pointer, not the pointed string.

Signed-off-by: Nicolas Pitre <>
  • Loading branch information...
Nicolas Pitre authored and jhedberg committed Jul 3, 2019
1 parent 9e57338 commit 2dc6eea143c013a822af803b70572b33903151de
Showing with 1 addition and 1 deletion.
  1. +1 −1 tests/bluetooth/gatt/src/main.c
@@ -260,7 +260,7 @@ void test_gatt_write(void)
zassert_not_null(attr, "Attribute don't match");

ret = attr->write(NULL, attr, (void *)value, strlen(value), 0, 0);
zassert_equal(ret, sizeof(value), "Attribute write unexpected return");
zassert_equal(ret, strlen(value), "Attribute write unexpected return");
zassert_mem_equal(value, test_value, ret,
"Attribute write value don't match");

0 comments on commit 2dc6eea

Please sign in to comment.
You can’t perform that action at this time.