Handle snprintf() returning < 0 (not just -1)

MFC after:	2 weeks
This commit is contained in:
brian 2001-08-20 15:44:17 +00:00
parent f6df81abf7
commit 903d158fae

View File

@ -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;