iio: test: Use strscpy() to copy the test description

The buffer length is known to be KUNIT_PARAM_DESC_SIZE

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
David Laight 2026-06-06 21:26:31 +01:00 committed by Jonathan Cameron
parent 9fb6c7ba7b
commit 1a6808ca4a

View File

@ -575,7 +575,7 @@ static const struct rescale_tc_data offset_cases[] = {
static void case_to_desc(const struct rescale_tc_data *t, char *desc)
{
strcpy(desc, t->name);
strscpy(desc, t->name, KUNIT_PARAM_DESC_SIZE);
}
KUNIT_ARRAY_PARAM(iio_rescale_scale, scale_cases, case_to_desc);