On Sun, Nov 25, 2018 at 12:32:23AM +0100, Jan Klemkow wrote:
> Hi,
> 
> This diff fixes some -Wsign-compare compiler warnings in ftpd(8) by
> using the right types for 'i' and 'len'.  One warning is left, but I
> don't see that it's fixable without suppressing the warning by a cast of
> len to size_t.  And casting might be controversial in this case?!

The diff looks correct to me. If anyone wants to commit

ok tb

> /usr/src/libexec/ftpd/ftpd.c:2781:11: warning: comparison of integers of
> different signs: 'int' and
>       'unsigned long' [-Wsign-compare]
>                 if (len >= sizeof(buf) || len == -1) {
>                     ~~~ ^  ~~~~~~~~~~~

This test is the wrong way around: compare CAVEATS in snprintf(3).

There's a ton of unchecked snprintfs in this code. Did you take a look
at those?

Reply via email to