1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-02 12:20:51 +00:00

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

MFC after:	2 weeks
This commit is contained in:
Brian Somers 2001-08-20 15:44:17 +00:00
parent 6d3e1426db
commit 778de35906
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81985

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;