On Mon, 29 Jul 2019, Chuhong Yuan wrote:

> strncmp(str, const, len) is error-prone.
> We had better use newly introduced
> str_has_prefix() instead of it.

Can you please provide a proper explanation why the below strncmp() is
error prone?

Just running a script and copying some boiler plate changelog saying
'strncmp() is error prone' does not cut it.

> -     if (!strncmp(buf, "trigger", size)) {
> +     if (str_has_prefix(buf, "trigger")) {

Especially when the resulting code is not equivalent.

Thanks,

        tglx

Reply via email to