summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-01-21 12:11:59 +0100
committerMax Kellermann <max@musicpd.org>2019-01-21 12:12:36 +0100
commit85f77ec81db7a208941b5459741272ab70235e01 (patch)
treed333d2f431bc9ec9750d0f571169327eddbe4a47 /test
parent37debed0b827eb272f6e1040e80ea8f09203d153 (diff)
test/net/TestLocalSocketAddress: can't use strcmp() if the string isn't null-terminated.
Diffstat (limited to 'test')
-rw-r--r--test/net/TestLocalSocketAddress.cxx2
1 files changed, 1 insertions, 1 deletions
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());
}