Fix compilation with DEBUG. Split out & improve list parser

Various errors in DEBUG code.

List parser for devices and labels used unchecked fixed-size arrays.

Make dynamic, and deal with ", "

Add some paranoia checks to diskio.  Fix memory leak under WIN32.

In phynt, write in the right direction (from Larry Baker notes)
This commit is contained in:
Timothe Litt
2016-03-03 15:49:13 -05:00
parent b2c51a08ad
commit 101a03ee30
7 changed files with 77 additions and 38 deletions

View File

@@ -517,7 +517,7 @@ unsigned accesschunk(struct FCB *fcb,unsigned vbn,struct VIOC **retvioc,
register unsigned int blocks;
register struct VIOC *vioc;
#ifdef DEBUG
printf("Access chunk %8x %d (%x)\n",base,vbn,fcb->cache.hashval);
printf("Access chunk %d (%x)\n",vbn,fcb->cache.hashval);
#endif
if (vbn < 1 || vbn > fcb->hiblock) return SS$_ENDOFFILE;
blocks = (vbn - 1) / VIOC_CHUNKSIZE * VIOC_CHUNKSIZE;
@@ -721,10 +721,6 @@ unsigned dismount(struct VCB * vcb)
if (sts & 1) {
cache_remove(&vcb->fcb->cache);
while (vcb->dircache) cache_delete((struct CACHE *) vcb->dircache);
#ifdef DEBUG
printf("Post close\n");
cachedump();
#endif
free(vcb);
}
}