Skip to content

Commit

Permalink
strcpy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gafferongames committed Dec 26, 2023
1 parent a147a84 commit 59cd564
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion source/yojimbo_base_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ namespace yojimbo
}
reliable_config_t reliable_config;
reliable_default_config( &reliable_config );
strcpy( reliable_config.name, "client endpoint" );
#if defined(_MSC_VER)
strcpy_s( reliable_config.name, sizeof( reliable_config.name ), "client endpoint" );
#else
strcpy( reliable_config.name, "client endpoint" );
#endif
reliable_config.context = (void*) this;
reliable_config.max_packet_size = m_config.maxPacketSize;
reliable_config.fragment_above = m_config.fragmentPacketsAbove;
Expand Down
6 changes: 5 additions & 1 deletion source/yojimbo_base_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ namespace yojimbo

reliable_config_t reliable_config;
reliable_default_config( &reliable_config );
strcpy( reliable_config.name, "server endpoint" );
#if defined(_MSC_VER)
strcpy_s( reliable_config.name, sizeof( reliable_config.name ), "server endpoint" );
#else
strcpy( reliable_config.name, "server endpoint" );
#endif
reliable_config.context = (void*) this;
reliable_config.index = i;
reliable_config.max_packet_size = m_config.maxPacketSize;
Expand Down

0 comments on commit 59cd564

Please sign in to comment.