diff --git a/examples/client/client.c b/examples/client/client.c index c72ea728af..ca47164020 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -2391,7 +2391,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) err_sys("provided connection ID is too big"); } else { - strncpy(dtlsCID, myoptarg, DTLS_CID_BUFFER_SIZE-1); + XSTRLCPY(dtlsCID, myoptarg, DTLS_CID_BUFFER_SIZE); } } break; diff --git a/examples/server/server.c b/examples/server/server.c index 95a106d702..2b72a1de9b 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -2411,7 +2411,7 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args) err_sys("provided connection ID is too big"); } else { - strncpy(dtlsCID, myoptarg, DTLS_CID_BUFFER_SIZE-1); + XSTRLCPY(dtlsCID, myoptarg, DTLS_CID_BUFFER_SIZE); } } break;