mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
Userland: Use uniform initialization instead of memset
This commit is contained in:
parent
cbd8f78cce
commit
3019445492
Notes:
sideshowbarker
2024-07-18 22:03:44 +09:00
Author: https://github.com/bgianfo
Commit: 3019445492
Pull-request: https://github.com/SerenityOS/serenity/pull/5449
Reviewed-by: https://github.com/awesomekling
2 changed files with 6 additions and 7 deletions
|
@ -63,8 +63,8 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
struct sockaddr_in sa;
|
||||
memset(&sa, 0, sizeof sa);
|
||||
struct sockaddr_in sa {
|
||||
};
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = htons(port);
|
||||
sa.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
|
@ -133,9 +133,8 @@ int main(int argc, char** argv)
|
|||
|
||||
char addr_str[INET_ADDRSTRLEN];
|
||||
|
||||
struct sockaddr_in dst_addr;
|
||||
memset(&dst_addr, 0, sizeof(dst_addr));
|
||||
|
||||
struct sockaddr_in dst_addr {
|
||||
};
|
||||
dst_addr.sin_family = AF_INET;
|
||||
dst_addr.sin_port = htons(port);
|
||||
if (inet_pton(AF_INET, addr, &dst_addr.sin_addr) < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue