From 85f77ec81db7a208941b5459741272ab70235e01 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 21 Jan 2019 12:11:59 +0100 Subject: test/net/TestLocalSocketAddress: can't use strcmp() if the string isn't null-terminated. --- test/net/TestLocalSocketAddress.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/net/TestLocalSocketAddress.cxx b/test/net/TestLocalSocketAddress.cxx index 1eef4882f..8ba61fc27 100644 --- a/test/net/TestLocalSocketAddress.cxx +++ b/test/net/TestLocalSocketAddress.cxx @@ -67,7 +67,7 @@ TEST(LocalSocketAddress, Abstract) EXPECT_EQ(sun.sun_path[0], 0); /* ... but are not null-terminated */ - EXPECT_STREQ(sun.sun_path + 1, path + 1); + EXPECT_EQ(memcmp(sun.sun_path + 1, path + 1, strlen(path) - 1), 0); EXPECT_EQ(sun.sun_path + strlen(path), (const char *)a.GetAddress() + a.GetSize()); } -- cgit v1.2.3