mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 08:57:35 +00:00
Tests: Prefer strlcpy over strncpy
Because it looks nicer.
This commit is contained in:
parent
cb52bfdd27
commit
7a2b5d1328
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