From 301944549288233565a874725669e5b32f35cdb6 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 21 Feb 2021 02:20:20 -0800 Subject: [PATCH] Userland: Use uniform initialization instead of memset --- Userland/Applications/Debugger/main.cpp | 4 ++-- Userland/Utilities/nc.cpp | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Userland/Applications/Debugger/main.cpp b/Userland/Applications/Debugger/main.cpp index ef5bbe96711..145f71a995f 100644 --- a/Userland/Applications/Debugger/main.cpp +++ b/Userland/Applications/Debugger/main.cpp @@ -213,8 +213,8 @@ int main(int argc, char** argv) } g_debug_session = result.release_nonnull(); - struct sigaction sa; - memset(&sa, 0, sizeof(struct sigaction)); + struct sigaction sa { + }; sa.sa_handler = handle_sigint; sigaction(SIGINT, &sa, nullptr); diff --git a/Userland/Utilities/nc.cpp b/Userland/Utilities/nc.cpp index 40c406c377d..e50353d8793 100644 --- a/Userland/Utilities/nc.cpp +++ b/Userland/Utilities/nc.cpp @@ -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) {