diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2020-08-23 15:28:32 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-24 00:45:03 +0200 |
commit | 7a2b5d1328fa19d38e45f9b7ded86f92b1bfff8a (patch) | |
tree | 0d2591b40d5f67416d74f176c0a9871c1217a063 | |
parent | cb52bfdd27f44ca1fe357120f388ac4bdf6d4f8d (diff) | |
download | serenity-7a2b5d1328fa19d38e45f9b7ded86f92b1bfff8a.zip |
Tests: Prefer strlcpy over strncpy
Because it looks nicer.
-rw-r--r-- | Userland/Tests/Kernel/bind-local-socket-to-symlink.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Tests/Kernel/bind-local-socket-to-symlink.cpp b/Userland/Tests/Kernel/bind-local-socket-to-symlink.cpp index ce4bfc4a3f..a25c9c8962 100644 --- a/Userland/Tests/Kernel/bind-local-socket-to-symlink.cpp +++ b/Userland/Tests/Kernel/bind-local-socket-to-symlink.cpp @@ -47,7 +47,7 @@ int main(int, char**) struct sockaddr_un addr; memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; - strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1); + strlcpy(addr.sun_path, path, sizeof(addr.sun_path)); rc = bind(fd, (struct sockaddr*)(&addr), sizeof(addr)); if (rc < 0 && errno == EADDRINUSE) { |