diff options
Diffstat (limited to 'Source/charon/tests')
-rw-r--r-- | Source/charon/tests/socket_test.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/charon/tests/socket_test.c b/Source/charon/tests/socket_test.c index 4e761496b..a8ced751d 100644 --- a/Source/charon/tests/socket_test.c +++ b/Source/charon/tests/socket_test.c @@ -39,9 +39,9 @@ void test_socket(tester_t *tester) char *test_string = "Testing functionality of socket_t"; - pkt->data.ptr = alloc_bytes(strlen(test_string),"test_string"); - memcpy(pkt->data.ptr,test_string,strlen(test_string)); - pkt->data.len = strlen(test_string); + pkt->data.ptr = alloc_bytes(strlen(test_string) + 1,"test_string"); + memcpy(pkt->data.ptr,test_string,strlen(test_string) + 1); + pkt->data.len = strlen(test_string) + 1; /* send to previously bound socket */ pkt->set_destination(pkt, "127.0.0.1", 4500); |