LibC: The port numbers returned by getservby*() should be in network byte order

This commit is contained in:
Gunnar Beutner 2021-04-12 16:44:40 +02:00 committed by Andreas Kling
parent 287a93a2a4
commit 8fcf91b030
Notes: sideshowbarker 2024-07-18 20:27:06 +09:00

View file

@ -342,7 +342,7 @@ struct servent* getservent()
return nullptr;
__getserv_buffer.s_name = const_cast<char*>(__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<char*>(__getserv_protocol_buffer.characters());
__getserv_alias_list.clear_with_capacity();