test-lldp: use `memcmp` to compare bytes (#8054)

Technically, `data` is a sequence of bytes without a trailing zero,
so the use of `memcmp` seems to be logical here. Besides, this helps get
around a bug that makes `asan` report the false positive mentioned in
 #8052.

Closes #8052.
This commit is contained in:
Evgeny Vereshchagin 2018-01-31 11:54:37 +03:00 committed by Lennart Poettering
parent 302af1c250
commit ce691f31aa
1 changed files with 1 additions and 1 deletions

View File

@ -139,7 +139,7 @@ static void test_receive_basic_packet(sd_event *e) {
assert_se(sd_lldp_neighbor_get_port_id(neighbors[0], &type, &data, &length) == 0);
assert_se(type == SD_LLDP_PORT_SUBTYPE_INTERFACE_NAME);
assert_se(length == 3);
assert_se(strneq((char *) data, "1/3", 3));
assert_se(!memcmp(data, "1/3", 3));
assert_se(sd_lldp_neighbor_get_port_description(neighbors[0], &str) == 0);
assert_se(streq(str, "Port"));