When encoding an smb name, truncate one byte earlier in order than we did

previously in order to ensure it fit properly in the bufer when encoded.
This prevents a debugging printf from firing if a source or destination
host name for an smb mount exceeds 15 characters.

MFC after:	3 days
Obtained from:	Apple, Inc.
This commit is contained in:
Robert Watson 2008-11-02 19:48:15 +00:00
parent e0dec6ebb1
commit 6966d7767a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184567

View file

@ -169,7 +169,7 @@ nb_name_encode(struct nb_name *np, u_char *dst)
memsetw(cp + 2, NB_NAMELEN - 1, NBENCODE(' '));
cp += NB_ENCNAMELEN;
} else {
for (i = 0; *name && i < NB_NAMELEN; i++, cp += 2, name++)
for (i = 0; *name && i < NB_NAMELEN - 1; i++, cp += 2, name++)
*(u_short*)cp = NBENCODE(toupper(*name));
i = NB_NAMELEN - i - 1;
if (i > 0) {