Restore necessary NUL termination of locname.

Submitted by:	ian dowse
MFC after:	2 days
This commit is contained in:
Warner Losh 2009-01-28 16:23:21 +00:00
parent e35054ca90
commit 688ff09fed
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187828

View File

@ -545,6 +545,7 @@ printlist(char *name, char *basename)
strcmp(dp->d_name, ".") == 0 ||
strcmp(dp->d_name, "..") == 0))
continue;
locname[namelen] = '\0';
if (namelen + dp->d_namlen >= MAXPATHLEN) {
fprintf(stderr, "%s%s: name exceeds %d char\n",
locname, dp->d_name, MAXPATHLEN);