Re: [PATCH v7 1/4] fs: unicode: Use strscpy() instead of strncpy()

2021-04-07 Thread Eric Biggers
On Wed, Apr 07, 2021 at 08:18:42PM +0530, Shreeya Patel wrote: > The -Wstringop-truncation warning highlights the unintended > uses of the strncpy function that truncate the terminating NULL > character from the source string. > Unlike strncpy(), strscpy() always null-terminates the destination

[PATCH v7 1/4] fs: unicode: Use strscpy() instead of strncpy()

2021-04-07 Thread Shreeya Patel
Following warning was reported by Kernel Test Robot. In function 'utf8_parse_version', inlined from 'utf8_load' at fs/unicode/utf8mod.c:195:7: >> fs/unicode/utf8mod.c:175:2: warning: 'strncpy' specified bound 12 equals destination size [-Wstringop-truncation] 175 | strncpy(version_string,