Commit fc24bd84 authored by Keith Packard's avatar Keith Packard Committed by Henrik Brix Andersen
Browse files

tests/nrf: Use memcpy instead of strncpy to avoid gcc warnings



While strncpy will work here, this isn't testing strings, it's testing
byte arrays, so use memcpy

Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent ec38e9ef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ ZTEST_USER_F(i2c_api_twis, test_i2c_read_write)
ZTEST_USER_F(i2c_api_twis, test_i2c_read)
{
	/* Prepare slave data */
	strncpy(fixture->slave_buffer, msg, TEST_DATA_SIZE);
	memcpy(fixture->slave_buffer, msg, TEST_DATA_SIZE);
	zassert_mem_equal(fixture->slave_buffer, msg, TEST_DATA_SIZE);

	int ret = i2c_read(fixture->dev, fixture->master_buffer, TEST_DATA_SIZE, fixture->addr);