diff --git a/reliable.c b/reliable.c index e5880cc..c863802 100644 --- a/reliable.c +++ b/reliable.c @@ -2088,21 +2088,13 @@ void test_packets() sender_config.fragment_above = 500; receiver_config.fragment_above = 500; -#if defined(_MSC_VER) - strcpy_s( sender_config.name, sizeof( sender_config.name ), "sender" ); -#else - strcpy( sender_config.name, "sender" ); -#endif + reliable_copy_string( sender_config.name, "sender", sizeof( sender_config.name ) ); sender_config.context = &context; sender_config.id = 0; sender_config.transmit_packet_function = &test_transmit_packet_function; sender_config.process_packet_function = &test_process_packet_function_validate; -#if defined(_MSC_VER) - strcpy_s( receiver_config.name, sizeof( receiver_config.name ), "receiver" ); -#else - strcpy( receiver_config.name, "receiver" ); -#endif + reliable_copy_string( receiver_config.name, "receiver", sizeof( receiver_config.name ) ); receiver_config.context = &context; receiver_config.id = 1; receiver_config.transmit_packet_function = &test_transmit_packet_function; @@ -2162,21 +2154,13 @@ void test_large_packets() sender_config.fragment_above = TEST_MAX_PACKET_BYTES; receiver_config.fragment_above = TEST_MAX_PACKET_BYTES; -#if defined(_MSC_VER) - strcpy_s( sender_config.name, sizeof( sender_config.name ), "sender" ); -#else - strcpy( sender_config.name, "sender" ); -#endif + reliable_copy_string( sender_config.name, "sender", sizeof( sender_config.name ) ); sender_config.context = &context; sender_config.id = 0; sender_config.transmit_packet_function = &test_transmit_packet_function; sender_config.process_packet_function = &test_process_packet_function_validate_large; -#if defined(_MSC_VER) - strcpy_s( receiver_config.name, sizeof( receiver_config.name ), "receiver" ); -#else - strcpy( receiver_config.name, "receiver" ); -#endif + reliable_copy_string( receiver_config.name, "receiver", sizeof( receiver_config.name ) ); receiver_config.context = &context; receiver_config.id = 1; receiver_config.transmit_packet_function = &test_transmit_packet_function; @@ -2222,21 +2206,13 @@ void test_sequence_buffer_rollover() sender_config.fragment_above = 500; receiver_config.fragment_above = 500; -#if defined(_MSC_VER) - strcpy_s( sender_config.name, sizeof( sender_config.name ), "sender" ); -#else - strcpy( sender_config.name, "sender" ); -#endif + reliable_copy_string( sender_config.name, "sender", sizeof( sender_config.name ) ); sender_config.context = &context; sender_config.id = 0; sender_config.transmit_packet_function = &test_transmit_packet_function; sender_config.process_packet_function = &test_process_packet_function; -#if defined(_MSC_VER) - strcpy_s( receiver_config.name, sizeof( receiver_config.name ), "receiver" ); -#else - strcpy( receiver_config.name, "receiver" ); -#endif + reliable_copy_string( receiver_config.name, "receiver", sizeof( receiver_config.name ) ); receiver_config.context = &context; receiver_config.id = 1; receiver_config.transmit_packet_function = &test_transmit_packet_function; @@ -2335,21 +2311,13 @@ void test_fragment_cleanup() receiver_config.free_function = &test_tracking_free_function; receiver_config.fragment_reassembly_buffer_size = 4; -#if defined(_MSC_VER) - strcpy_s( sender_config.name, sizeof( sender_config.name ), "sender" ); -#else - strcpy( sender_config.name, "sender" ); -#endif + reliable_copy_string( sender_config.name, "sender", sizeof( sender_config.name ) ); sender_config.context = &context; sender_config.id = 0; sender_config.transmit_packet_function = &test_transmit_packet_function; sender_config.process_packet_function = &test_process_packet_function; -#if defined(_MSC_VER) - strcpy_s( receiver_config.name, sizeof( receiver_config.name ), "receiver" ); -#else - strcpy( receiver_config.name, "receiver" ); -#endif + reliable_copy_string( receiver_config.name, "receiver", sizeof( receiver_config.name ) ); receiver_config.context = &context; receiver_config.id = 1; receiver_config.transmit_packet_function = &test_transmit_packet_function; diff --git a/soak.c b/soak.c index d0b61ac..81458db 100644 --- a/soak.c +++ b/soak.c @@ -168,21 +168,13 @@ void soak_initialize() client_config.fragment_above = 500; server_config.fragment_above = 500; -#ifdef _MSC_VER - strcpy_s( client_config.name, sizeof( client_config.name ), "client" ); -#else - strcpy( client_config.name, "client" ); -#endif + reliable_copy_string( client_config.name, "client", sizeof( client_config.name ) ); client_config.context = &global_context; client_config.id = 0; client_config.transmit_packet_function = &test_transmit_packet_function; client_config.process_packet_function = &test_process_packet_function; -#ifdef _MSC_VER - strcpy_s( server_config.name, sizeof( server_config.name ), "server" ); -#else - strcpy( server_config.name, "server" ); -#endif + reliable_copy_string( server_config.name, "server", sizeof( server_config.name ) ); server_config.context = &global_context; server_config.id = 1; server_config.transmit_packet_function = &test_transmit_packet_function; diff --git a/stats.c b/stats.c index e196cf3..3767524 100644 --- a/stats.c +++ b/stats.c @@ -165,21 +165,13 @@ void stats_initialize() client_config.fragment_above = MAX_PACKET_BYTES; server_config.fragment_above = MAX_PACKET_BYTES; -#ifdef _MSC_VER - strcpy_s( client_config.name, sizeof( client_config.name ), "client" ); -#else - strcpy( client_config.name, "client" ); -#endif + reliable_copy_string( client_config.name, "client", sizeof( client_config.name ) ); client_config.context = &global_context; client_config.id = 0; client_config.transmit_packet_function = &test_transmit_packet_function; client_config.process_packet_function = &test_process_packet_function; -#ifdef _MSC_VER - strcpy_s( server_config.name, sizeof( server_config.name ), "server" ); -#else - strcpy( server_config.name, "server" ); -#endif + reliable_copy_string( server_config.name, "server", sizeof( server_config.name ) ); server_config.context = &global_context; server_config.id = 1; server_config.transmit_packet_function = &test_transmit_packet_function;