Skip to content

Commit

Permalink
MFC: r173282
Browse files Browse the repository at this point in the history
Use getcwd() instead of getwd().  The former includes buffer length
checks, so it's probably "safer" to use in mtree.

Approved by:    re (kib)
  • Loading branch information
gkeramidas committed Dec 6, 2008
1 parent b29525c commit e092e02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr.sbin/mtree/mtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ main(int argc, char *argv[])
if (dir && chdir(dir))
err(1, "%s", dir);

if ((cflag || sflag) && !getwd(fullpath))
if ((cflag || sflag) && !getcwd(fullpath, sizeof(fullpath)))
errx(1, "%s", fullpath);

if (cflag) {
Expand Down

0 comments on commit e092e02

Please sign in to comment.