mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sockaddr_un address;
|
sockaddr_un address {
|
||||||
address.sun_family = AF_LOCAL;
|
AF_LOCAL,
|
||||||
strlcpy(address.sun_path, "/tmp/portal/lookup", sizeof(address.sun_path));
|
"/tmp/portal/lookup"
|
||||||
|
};
|
||||||
|
|
||||||
if (connect(fd, (const sockaddr*)&address, sizeof(address)) < 0) {
|
if (connect(fd, (const sockaddr*)&address, sizeof(address)) < 0) {
|
||||||
perror("connect_to_lookup_server");
|
perror("connect_to_lookup_server");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue