aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-02-07 12:25:49 -0500
committerNick Mathewson <nickm@torproject.org>2014-02-07 12:25:49 -0500
commitaa3c8c1397beff01fca186f176cd9fe1fa528aed (patch)
tree604b123f3f0121a51dd3e92029e2b8a557c43418 /src/test
parentf1682a615f9af50f4380bf1bb44070f299422a0a (diff)
downloadtor-aa3c8c1397beff01fca186f176cd9fe1fa528aed.tar
tor-aa3c8c1397beff01fca186f176cd9fe1fa528aed.tar.gz
Use the right functions; strncpy is usually not the answer
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_nodelist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test_nodelist.c b/src/test/test_nodelist.c
index cbdc4a72b..600e6a89d 100644
--- a/src/test/test_nodelist.c
+++ b/src/test/test_nodelist.c
@@ -47,9 +47,9 @@ test_nodelist_node_get_verbose_nickname_not_named(void *arg)
memset(&mock_rs, 0, sizeof(routerstatus_t));
/* verbose nickname should use ~ instead of = for unnamed routers */
- strncpy(mock_rs.nickname, "TestOR", 6);
+ strlcpy(mock_rs.nickname, "TestOR", sizeof(mock_rs.nickname));
mock_node.rs = &mock_rs;
- strncpy(mock_node.identity,
+ memcpy(mock_node.identity,
"\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA"
"\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA",
DIGEST_LEN);