From 8fcf91b030ceb17105ce02372c4a57bf49951678 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 12 Apr 2021 16:44:40 +0200 Subject: [PATCH] LibC: The port numbers returned by getservby*() should be in network byte order --- Userland/Libraries/LibC/netdb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibC/netdb.cpp b/Userland/Libraries/LibC/netdb.cpp index 2450d0a0e9c..915d96332fb 100644 --- a/Userland/Libraries/LibC/netdb.cpp +++ b/Userland/Libraries/LibC/netdb.cpp @@ -342,7 +342,7 @@ struct servent* getservent() return nullptr; __getserv_buffer.s_name = const_cast(__getserv_name_buffer.characters()); - __getserv_buffer.s_port = __getserv_port_buffer; + __getserv_buffer.s_port = htons(__getserv_port_buffer); __getserv_buffer.s_proto = const_cast(__getserv_protocol_buffer.characters()); __getserv_alias_list.clear_with_capacity();