techpack: audio: Fix false positive -Wstrlcpy-strlcat-size

strlen(swr_dmic_name_prefix_of) + 1 bytes are allocated for prefix_name just above

techpack/audio/asoc/codecs/swr-dmic.c:685:11: error: size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination [-Werror,-Wstrlcpy-strlcat-size]
                        strlen(swr_dmic_name_prefix_of) + 1);
                        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Change-Id: I808b4f135d42fc50587eeb9348848f7e0a3561cc
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
This commit is contained in:
Alexander Winkowski 2024-03-04 17:01:23 +00:00
commit 8f2a69d5a3
No known key found for this signature in database
GPG key ID: 72762A66704CDE44

View file

@ -681,8 +681,7 @@ static int swr_dmic_probe(struct swr_device *pdev)
ret = -ENOMEM;
goto dev_err;
}
strlcpy(prefix_name, swr_dmic_name_prefix_of,
strlen(swr_dmic_name_prefix_of) + 1);
strlcpy(prefix_name, swr_dmic_name_prefix_of, sizeof(prefix_name));
component->name_prefix = prefix_name;
return 0;