From bad8106bc0fc8f509e9a29d7de301dc46d604abe Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sun, 23 Jan 2011 14:47:41 -0600 Subject: Various output and progress tweaks. --- src/debug.h | 1 + src/list.c | 2 +- src/misc.c | 3 +-- src/ntfsx.c | 1 + src/scrounge.c | 9 ++++++--- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/debug.h b/src/debug.h index ea39d97..debca2d 100644 --- a/src/debug.h +++ b/src/debug.h @@ -20,6 +20,7 @@ #ifdef _DEBUG #include +#include #ifndef ASSERT #ifdef ATLASSERT diff --git a/src/list.c b/src/list.c index 05c4fdc..773f4ec 100644 --- a/src/list.c +++ b/src/list.c @@ -109,7 +109,7 @@ int printPartitionInfo(int dd, uint64 tblSector) #else printf(" %-15llu %-15llu ", (unsigned long long)(tblSector + mbr.partitions[i].startsec), - (unsigned long long)tblSector + mbr.partitions[i].endsec)); + (unsigned long long)(tblSector + mbr.partitions[i].endsec)); #endif printNTFSInfo(dd, tblSector + (uint64)mbr.partitions[i].startsec); diff --git a/src/misc.c b/src/misc.c index 4163348..1cb23ae 100644 --- a/src/misc.c +++ b/src/misc.c @@ -22,7 +22,6 @@ #include "memref.h" #include "locks.h" - /* These locks are used to signify which */ struct drivelock { @@ -74,7 +73,7 @@ uint64 checkLocationLock(drivelocks* locks, uint64 sec) sec < locks->_locks[i].end) { locked = locks->_locks[i].end - sec; - assert(locked != 0); + ASSERT(locked != 0); return locked; } } diff --git a/src/ntfsx.c b/src/ntfsx.c index 791fc16..9d5aa96 100644 --- a/src/ntfsx.c +++ b/src/ntfsx.c @@ -473,6 +473,7 @@ bool ntfsx_record_read(ntfsx_record* record, uint64 begSector, int dd) !ntfs_dofixups(record->_clus.data, record->_clus.size)) { warnx("invalid mft record"); + errno = EINVAL; ntfsx_cluster_release(&(record->_clus)); return false; } diff --git a/src/scrounge.c b/src/scrounge.c index a5670d7..61c2987 100644 --- a/src/scrounge.c +++ b/src/scrounge.c @@ -184,6 +184,12 @@ void processMFTRecord(partitioninfo* pi, uint64 sector, uint32 flags) if(!fcscmp(basics.filename, FC_DOT)) RETURN; +#if 0 + printf("SECTOR: %llu", (unsigned long long)sector); +#endif + printf(flags & PROCESS_MFT_FLAG_SUB ? + "\\" FC_PRINTF : "\\" FC_PRINTF "\n", basics.filename); + /* System, Hidden files that begin with $ are skipped */ if(basics.flags & kNTFS_FileSystem && basics.flags & kNTFS_FileHidden && @@ -205,9 +211,6 @@ void processMFTRecord(partitioninfo* pi, uint64 sector, uint32 flags) } } - printf(flags & PROCESS_MFT_FLAG_SUB ? - "\\" FC_PRINTF : "\\" FC_PRINTF "\n", basics.filename); - /* Directory handling: */ if(header->flags & kNTFS_RecFlagDir) { -- cgit v1.2.3