X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=restore%2Fdirs.c;h=2a23f9486b62c940530954b69b1bdf346ff3b8f7;hp=f93e19f32d064200e760c89cdb41b4ee26356e03;hb=498a402f5c76583149433224df7b8fcf88647a04;hpb=e4e31ce9eb383940daa3d9d0d7023b570b1aac4c diff --git a/restore/dirs.c b/restore/dirs.c index f93e19f..2a23f94 100644 --- a/restore/dirs.c +++ b/restore/dirs.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: dirs.c,v 1.25 2004/03/29 13:57:29 stelian Exp $"; + "$Id: dirs.c,v 1.28 2004/05/25 10:39:30 stelian Exp $"; #endif /* not lint */ #include @@ -384,7 +384,7 @@ putdir(char *buf, size_t size) struct direct *dp; long loc, i; - if (cvtflag) { + if (cvtflag && !ufs2flag) { eodp = (struct odirect *)&buf[size]; for (odp = (struct odirect *)buf; odp < eodp; odp++) if (odp->d_ino != 0) { @@ -419,8 +419,11 @@ putdir(char *buf, size_t size) i = DIRBLKSIZ - (loc & (DIRBLKSIZ - 1)); if ((dp->d_reclen & 0x3) != 0 || dp->d_reclen > i || - dp->d_reclen < DIRSIZ(0, dp) || - dp->d_namlen > MAXNAMLEN) { + dp->d_reclen < DIRSIZ(0, dp) +#if MAXNAMLEN < 255 + || dp->d_namlen > MAXNAMLEN +#endif + ) { Vprintf(stdout, "Mangled directory: "); if ((dp->d_reclen & 0x3) != 0) Vprintf(stdout, @@ -429,10 +432,12 @@ putdir(char *buf, size_t size) Vprintf(stdout, "reclen less than DIRSIZ (%d < %d) ", dp->d_reclen, DIRSIZ(0, dp)); +#if MAXNAMLEN < 255 if (dp->d_namlen > MAXNAMLEN) Vprintf(stdout, "reclen name too big (%d > %d) ", dp->d_namlen, MAXNAMLEN); +#endif Vprintf(stdout, "\n"); loc += i; continue; @@ -513,7 +518,7 @@ rst_seekdir(RST_DIR *dirp, OFF_T loc, OFF_T base) return; loc -= base; if (loc < 0) - fprintf(stderr, "bad seek pointer to rst_seekdir %lld\n", loc); + fprintf(stderr, "bad seek pointer to rst_seekdir %lld\n", (long long int)loc); (void) LSEEK(dirp->dd_fd, base + (loc & ~(DIRBLKSIZ - 1)), SEEK_SET); dirp->dd_loc = loc & (DIRBLKSIZ - 1); if (dirp->dd_loc != 0)