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.11.0-rc1~242 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4cd95b5218bf16a9f45a3ce3ba3c5e7f6297842c;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);