=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/diff/diffdir.c,v retrieving revision 1.42 retrieving revision 1.43 diff -c -r1.42 -r1.43 *** src/usr.bin/diff/diffdir.c 2014/05/20 01:25:23 1.42 --- src/usr.bin/diff/diffdir.c 2015/01/16 06:40:07 1.43 *************** *** 1,4 **** ! /* $OpenBSD: diffdir.c,v 1.42 2014/05/20 01:25:23 guenther Exp $ */ /* * Copyright (c) 2003, 2010 Todd C. Miller --- 1,4 ---- ! /* $OpenBSD: diffdir.c,v 1.43 2015/01/16 06:40:07 deraadt Exp $ */ /* * Copyright (c) 2003, 2010 Todd C. Miller *************** *** 20,26 **** * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ - #include #include #include --- 20,25 ---- *************** *** 33,38 **** --- 32,38 ---- #include #include #include + #include #include "diff.h" #include "xmalloc.h" *************** *** 51,57 **** struct dirent *dent1, **dp1, **edp1, **dirp1 = NULL; struct dirent *dent2, **dp2, **edp2, **dirp2 = NULL; size_t dirlen1, dirlen2; ! char path1[MAXPATHLEN], path2[MAXPATHLEN]; int pos; dirlen1 = strlcpy(path1, *p1 ? p1 : ".", sizeof(path1)); --- 51,57 ---- struct dirent *dent1, **dp1, **edp1, **dirp1 = NULL; struct dirent *dent2, **dp2, **edp2, **dirp2 = NULL; size_t dirlen1, dirlen2; ! char path1[PATH_MAX], path2[PATH_MAX]; int pos; dirlen1 = strlcpy(path1, *p1 ? p1 : ".", sizeof(path1)); *************** *** 184,190 **** int flags) { flags |= D_HEADER; ! strlcpy(path1 + plen1, dp->d_name, MAXPATHLEN - plen1); if (stat(path1, &stb1) != 0) { if (!(Nflag || Pflag) || errno != ENOENT) { warn("%s", path1); --- 184,190 ---- int flags) { flags |= D_HEADER; ! strlcpy(path1 + plen1, dp->d_name, PATH_MAX - plen1); if (stat(path1, &stb1) != 0) { if (!(Nflag || Pflag) || errno != ENOENT) { warn("%s", path1); *************** *** 194,200 **** memset(&stb1, 0, sizeof(stb1)); } ! strlcpy(path2 + plen2, dp->d_name, MAXPATHLEN - plen2); if (stat(path2, &stb2) != 0) { if (!Nflag || errno != ENOENT) { warn("%s", path2); --- 194,200 ---- memset(&stb1, 0, sizeof(stb1)); } ! strlcpy(path2 + plen2, dp->d_name, PATH_MAX - plen2); if (stat(path2, &stb2) != 0) { if (!Nflag || errno != ENOENT) { warn("%s", path2);