
Dear Hoyeonjiki Kim,
In message CAL9K-_jni+850m5Zf7QPPeM+dmSxqSZ5AgirDnzE_2uxrO4Akg@mail.gmail.com you wrote:
As you referred, `strcmp` suffers with non-null terminated string(s). I'd also checked if using `strcmp` can cause some issues and seems it's **guaranteed** that there is no such issue in this context.
You ar4e probably right, but the problem with this approach is that what today is a verified context, may tomoroow change - a new use case may be added, which is not aware of this potential problem, and which thus triggers a (foreseeable and avoidable bug).
But if we need to specify that the context will not suffer anyway, there is an option to use `strncmp` with `PART_NAME_LEN` as max count param.
`PART_NAME_LEN` is the size of `info.name` which is a character buffer.
If we know we size (and apparewntly we do), we should use this with strncmp(). Just in case...
Best regards,
Wolfgang Denk