From: Jérémie Galarneau Date: Wed, 9 May 2018 01:22:36 +0000 (-0400) Subject: Fix: test uses sizeof() on the wrong operand of strncpy X-Git-Tag: v2.10.5~19 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ea1ddb8e66a79cd6ce470407a9f497d325e5c0bc;p=lttng-tools.git Fix: test uses sizeof() on the wrong operand of strncpy Signed-off-by: Jérémie Galarneau --- diff --git a/tests/unit/test_session.c b/tests/unit/test_session.c index 03e6b9161..cfbb52d04 100644 --- a/tests/unit/test_session.c +++ b/tests/unit/test_session.c @@ -157,7 +157,7 @@ static int destroy_one_session(struct ltt_session *session) int ret; char session_name[NAME_MAX]; - strncpy(session_name, session->name, sizeof(session->name)); + strncpy(session_name, session->name, sizeof(session_name)); session_name[sizeof(session_name) - 1] = '\0'; ret = session_destroy(session);