diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-10-15 18:26:31 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-10-15 19:40:51 +0200 |
commit | 69995bffb7f2fb589e2191523859afd896c02220 (patch) | |
tree | b3ce0f2724a4593217bf6d491b9b9e3594374d82 /src/test/test-socket-util.c | |
parent | 95cb14b0681692d372e7b0bfb3c9a9bbc6ffbd0d (diff) | |
download | systemd-69995bffb7f2fb589e2191523859afd896c02220.tar.gz |
socket-util: include trailing NUL byte in SOCKADDR_UN_LEN() count for fs sockets
This is what unix(7) recommends, hence do so.
Diffstat (limited to 'src/test/test-socket-util.c')
-rw-r--r-- | src/test/test-socket-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c index df18a2a83c..0de29c2235 100644 --- a/src/test/test-socket-util.c +++ b/src/test/test-socket-util.c @@ -405,7 +405,7 @@ static void test_sockaddr_un_len(void) { .sun_path = "\0foobar", }; - assert_se(SOCKADDR_UN_LEN(fs) == offsetof(struct sockaddr_un, sun_path) + strlen(fs.sun_path)); + assert_se(SOCKADDR_UN_LEN(fs) == offsetof(struct sockaddr_un, sun_path) + strlen(fs.sun_path) + 1); assert_se(SOCKADDR_UN_LEN(abstract) == offsetof(struct sockaddr_un, sun_path) + 1 + strlen(abstract.sun_path + 1)); } |