summaryrefslogtreecommitdiff
path: root/Userland/Utilities/nc.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-02-09 22:35:00 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-09 22:58:19 +0100
commit1fd349b8c2967c28033a08a71368a0b383be5203 (patch)
tree6c6dc59346c72856189ce672e9267e62051c6c2b /Userland/Utilities/nc.cpp
parentf24b674d7ad052e6eb68600fd7dddfd692920143 (diff)
downloadserenity-1fd349b8c2967c28033a08a71368a0b383be5203.zip
Userland: Use INET_ADDRSTRLEN for inet_ntop() buffers
There's no point in using different, seemingly randomly sized buffers as the required size for storing an IPv4 address representation is well known (16 bytes).
Diffstat (limited to 'Userland/Utilities/nc.cpp')
-rw-r--r--Userland/Utilities/nc.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Utilities/nc.cpp b/Userland/Utilities/nc.cpp
index 8d4f0a7613..40c406c377 100644
--- a/Userland/Utilities/nc.cpp
+++ b/Userland/Utilities/nc.cpp
@@ -85,7 +85,7 @@ int main(int argc, char** argv)
return 1;
}
- char addr_str[100];
+ char addr_str[INET_ADDRSTRLEN];
struct sockaddr_in sin;
socklen_t len;
@@ -131,7 +131,7 @@ int main(int argc, char** argv)
return 1;
}
- char addr_str[100];
+ char addr_str[INET_ADDRSTRLEN];
struct sockaddr_in dst_addr;
memset(&dst_addr, 0, sizeof(dst_addr));