diff options
author | Max Kellermann <max@musicpd.org> | 2019-01-21 12:11:59 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-01-21 12:12:36 +0100 |
commit | 85f77ec81db7a208941b5459741272ab70235e01 (patch) | |
tree | d333d2f431bc9ec9750d0f571169327eddbe4a47 /test | |
parent | 37debed0b827eb272f6e1040e80ea8f09203d153 (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.cxx | 2 |
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()); } |