Skip to content

Commit

Permalink
Fix for docker tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakio815 committed Jan 22, 2025
1 parent 70e9e57 commit dd4eb91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion network/impl/src/lf_socket_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ int get_peer_address(netdrv_t* drv) {
// the .server_hostname field of the federate.
char str[INET_ADDRSTRLEN + 1];
inet_ntop(AF_INET, &priv->server_ip_addr, str, INET_ADDRSTRLEN);
strncpy(priv->server_hostname, str, INET_ADDRSTRLEN);
strncpy(priv->server_hostname, str, INET_ADDRSTRLEN - 1); // Copy up to INET_ADDRSTRLEN - 1 characters
priv->server_hostname[INET_ADDRSTRLEN - 1] = '\0'; // Null-terminate explicitly

LF_PRINT_DEBUG("RTI got address %s", priv->server_hostname);
#endif
Expand Down

0 comments on commit dd4eb91

Please sign in to comment.