summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-05-11 21:14:04 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-05-11 21:14:04 +0000
commit0512a443bd51ce081dfd705f272e71f50dca7634 (patch)
treea97bd70a794c1886022237a09c11153afe71bb30
parentcccbd940537ba838440e5c7b60d015db472eec4a (diff)
struct direct's d_ino is no longer the same size as an ino_t, so copy it
for the call to bsearch() problem report and ok krw@
-rw-r--r--sbin/ncheck_ffs/ncheck_ffs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/ncheck_ffs/ncheck_ffs.c b/sbin/ncheck_ffs/ncheck_ffs.c
index 8875f871753..f398978fce1 100644
--- a/sbin/ncheck_ffs/ncheck_ffs.c
+++ b/sbin/ncheck_ffs/ncheck_ffs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncheck_ffs.c,v 1.38 2013/11/01 17:36:18 krw Exp $ */
+/* $OpenBSD: ncheck_ffs.c,v 1.39 2014/05/11 21:14:03 guenther Exp $ */
/*-
* Copyright (c) 1995, 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com>
@@ -412,6 +412,7 @@ searchdir(ino_t ino, daddr_t blkno, long size, off_t filesize,
void *di;
mode_t mode;
char *npath;
+ ino_t subino;
long loc;
if ((dblk = malloc(sblock->fs_bsize)) == NULL)
@@ -436,7 +437,8 @@ searchdir(ino_t ino, daddr_t blkno, long size, off_t filesize,
}
di = getino(dp->d_ino);
mode = DIP(di, di_mode) & IFMT;
- if (bsearch(&dp->d_ino, ilist, ninodes, sizeof(*ilist), matchino)) {
+ subino = dp->d_ino;
+ if (bsearch(&subino, ilist, ninodes, sizeof(*ilist), matchino)) {
if (format) {
format_entry(path, dp);
} else {