mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
LibC: strcpy a socket address at compile time
This way, we'd get compile-time errors if the address was too long for the buffer.
This commit is contained in:
parent
852454746e
commit
0817ef563e
1 changed files with 4 additions and 3 deletions
|
@ -82,9 +82,10 @@ static int connect_to_lookup_server()
|
|||
return -1;
|
||||
}
|
||||
|
||||
sockaddr_un address;
|
||||
address.sun_family = AF_LOCAL;
|
||||
strlcpy(address.sun_path, "/tmp/portal/lookup", sizeof(address.sun_path));
|
||||
sockaddr_un address {
|
||||
AF_LOCAL,
|
||||
"/tmp/portal/lookup"
|
||||
};
|
||||
|
||||
if (connect(fd, (const sockaddr*)&address, sizeof(address)) < 0) {
|
||||
perror("connect_to_lookup_server");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue