diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 25ea020ec700..93dacdb9efb0 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -744,7 +744,7 @@ _ftp_authenticate(int cd, struct url *url, struct url *purl) if (!pwd || !*pwd) { if ((logname = getlogin()) == 0) logname = FTP_ANONYMOUS_USER; - if ((len = snprintf(pbuf, MAXLOGNAME + 1, "%s@", logname)) == -1) + if ((len = snprintf(pbuf, MAXLOGNAME + 1, "%s@", logname)) < 0) len = 0; else if (len > MAXLOGNAME) len = MAXLOGNAME;