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.9.10~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f8ebe3ceca48ad97681ce18f2a8e41ff8cb718aa;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);