On 2025/4/25 16:55, Jani Nikula wrote:
>>              } else if (!strncmp(this_opt, "noscale", 7)) {
>>                      noscale = 1;
> A further cleanup could be to replace all of the strncmp's with
> str_has_prefix(this_opt, "...") to avoid this class of errors
> altogether. It also returns the length of the prefix on match, and that
> can be used to drop more magic numbers.

very agree with your point. may use strstarts().

there are many strncmp() usages with long const string and hardcoded
string length. some usages are wrong.



Reply via email to