Re: [PATCH] target/core: replace strncpy with strscpy

Martin K. Petersen
2025-07-25T01:52:02Z

Pranav,

> strncpy() is deprecated and its use is discouraged. Replace strncpy()
> with safer strscpy() as the p_buf buffer should be NUL-terminated,
> since it holds human readable debug output strings.

If you must do this, please change all the similar occurrences of
strncpy() in that file instead of just one of them.

However, given the fixed size of the buffer and the length of all the
defined static strings, what is the actual problem you are fixing?

--
Martin K. Petersen