mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Handle snprintf() returning < 0 (not just -1)
MFC after: 2 weeks
This commit is contained in:
parent
6d3e1426db
commit
778de35906
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue