mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +00:00
Tests: Prefer strlcpy over strncpy
Because it looks nicer.
This commit is contained in:
parent
cb52bfdd27
commit
7a2b5d1328
Notes:
sideshowbarker
2024-07-19 03:14:01 +09:00
Author: https://github.com/BenWiederhake
Commit: 7a2b5d1328
Pull-request: https://github.com/SerenityOS/serenity/pull/3275
Reviewed-by: https://github.com/awesomekling
1 changed files with 1 additions and 1 deletions
|
@ -47,7 +47,7 @@ int main(int, char**)
|
||||||
struct sockaddr_un addr;
|
struct sockaddr_un addr;
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
addr.sun_family = AF_UNIX;
|
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));
|
rc = bind(fd, (struct sockaddr*)(&addr), sizeof(addr));
|
||||||
if (rc < 0 && errno == EADDRINUSE) {
|
if (rc < 0 && errno == EADDRINUSE) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue