SCCS-vsn: lib/libc/gen/readdir.c 1.2
/* Copyright (c) 1982 Regents of the University of California */
/* Copyright (c) 1982 Regents of the University of California */
-static char sccsid[] = "@(#)readdir.c 1.1 %G%";
+static char sccsid[] = "@(#)readdir.c 1.2 %G%";
#include <sys/types.h>
#include <ndir.h>
#include <sys/types.h>
#include <ndir.h>
for (;;) {
if (dirp->dd_loc == 0) {
for (;;) {
if (dirp->dd_loc == 0) {
- dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, DIRSIZ);
+ dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
+ MAXDIRSIZ);
if (dirp->dd_size <= 0)
return NULL;
}
if (dirp->dd_size <= 0)
return NULL;
}
dirp->dd_loc = 0;
continue;
}
dirp->dd_loc = 0;
continue;
}
- dp = (struct direct *)dirp->dd_buf + dirp->dd_loc;
+ dp = (struct direct *)(dirp->dd_buf + dirp->dd_loc);
dirp->dd_loc += sizeof(struct direct);
if (dp->d_ino != 0)
return dp;
dirp->dd_loc += sizeof(struct direct);
if (dp->d_ino != 0)
return dp;