Minor fix
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 8s

This commit is contained in:
Stephen Seo 2024-09-12 14:55:51 +09:00
parent 8091c097b6
commit 371c180cc7

View file

@ -104,7 +104,7 @@ int create_tcp_socket(unsigned short port) {
} }
void cleanup_tcp_socket(int *tcp_socket) { void cleanup_tcp_socket(int *tcp_socket) {
if (tcp_socket && *tcp_socket != -1) { if (tcp_socket && *tcp_socket >= 0) {
close(*tcp_socket); close(*tcp_socket);
*tcp_socket = -1; *tcp_socket = -1;
} }