summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-03-25 14:34:35 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2011-03-25 14:34:35 +0100
commitb2ac7a67424be0bae302a8bea02b5af1a5d5eac7 (patch)
tree781e718840c8456ce2d407ee133ee71b53248d48 /src
parent4acc8c51bb94006ba263d7b40ba268bc296279e1 (diff)
PhotoRec: use "%llu" instead of "%lu" to display sectors offset
Diffstat (limited to 'src')
-rw-r--r--src/fat_unformat.c20
-rw-r--r--src/phbf.c6
-rw-r--r--src/phbs.c4
-rw-r--r--src/phnc.c12
-rw-r--r--src/phrecn.c8
-rw-r--r--src/sessionp.c9
6 files changed, 35 insertions, 24 deletions
diff --git a/src/fat_unformat.c b/src/fat_unformat.c
index 00ac269..661679b 100644
--- a/src/fat_unformat.c
+++ b/src/fat_unformat.c
@@ -108,7 +108,9 @@ static int pfind_sectors_per_cluster(disk_t *disk, partition_t *partition, const
buffer=buffer_start;
if(verbose>1)
{
- log_verbose("Reading sector %10lu/%lu\n",(unsigned long)((offset-partition->part_offset)/disk->sector_size),(unsigned long)((partition->part_size-1)/disk->sector_size));
+ log_verbose("Reading sector %10llu/%llu\n",
+ (unsigned long long)((offset-partition->part_offset)/disk->sector_size),
+ (unsigned long long)((partition->part_size-1)/disk->sector_size));
}
if(disk->pread(disk, buffer_start, READ_SIZE, offset) != READ_SIZE)
{
@@ -249,7 +251,9 @@ static int fat_unformat_aux(disk_t *disk, partition_t *partition, const int verb
buffer=buffer_start;
if(verbose>1)
{
- log_verbose("Reading sector %10lu/%lu\n",(unsigned long)((offset-partition->part_offset)/disk->sector_size),(unsigned long)((partition->part_size-1)/disk->sector_size));
+ log_verbose("Reading sector %10llu/%llu\n",
+ (unsigned long long)((offset-partition->part_offset)/disk->sector_size),
+ (unsigned long long)((partition->part_size-1)/disk->sector_size));
}
if(disk->pread(disk, buffer, READ_SIZE, offset) != READ_SIZE)
{
@@ -274,12 +278,12 @@ static int fat_unformat_aux(disk_t *disk, partition_t *partition, const int verb
previous_time=current_time;
wmove(stdscr,9,0);
wclrtoeol(stdscr);
- log_info("Reading sector %10lu/%lu, %u files found\n",
- (unsigned long)((offset-partition->part_offset)/disk->sector_size),
- (unsigned long)(partition->part_size/disk->sector_size), *file_nbr);
- wprintw(stdscr,"Reading sector %10lu/%lu, %u files found\n",
- (unsigned long)((offset-partition->part_offset)/disk->sector_size),
- (unsigned long)(partition->part_size/disk->sector_size), *file_nbr);
+ log_info("Reading sector %10llu/%llu, %u files found\n",
+ (unsigned long long)((offset-partition->part_offset)/disk->sector_size),
+ (unsigned long long)(partition->part_size/disk->sector_size), *file_nbr);
+ wprintw(stdscr,"Reading sector %10llu/%llu, %u files found\n",
+ (unsigned long long)((offset-partition->part_offset)/disk->sector_size),
+ (unsigned long long)(partition->part_size/disk->sector_size), *file_nbr);
wmove(stdscr,10,0);
wclrtoeol(stdscr);
wprintw(stdscr,"Elapsed time %uh%02um%02us",
diff --git a/src/phbf.c b/src/phbf.c
index 35c259a..198d5eb 100644
--- a/src/phbf.c
+++ b/src/phbf.c
@@ -291,9 +291,9 @@ int photorec_bf(disk_t *disk_car, partition_t *partition, const int verbose, con
buffer=buffer_olddata+blocksize;
if(verbose>1)
{
- log_verbose("Reading sector %10lu/%lu\n",
- (unsigned long)((offset-partition->part_offset)/disk_car->sector_size),
- (unsigned long)((partition->part_size-1)/disk_car->sector_size));
+ log_verbose("Reading sector %10llu/%llu\n",
+ (unsigned long long)((offset-partition->part_offset)/disk_car->sector_size),
+ (unsigned long long)((partition->part_size-1)/disk_car->sector_size));
}
disk_car->pread(disk_car, buffer, READ_SIZE, offset);
}
diff --git a/src/phbs.c b/src/phbs.c
index 2e80ff7..f6af9fa 100644
--- a/src/phbs.c
+++ b/src/phbs.c
@@ -199,7 +199,9 @@ int photorec_find_blocksize(disk_t *disk_car, partition_t *partition, const int
buffer=buffer_olddata+*blocksize;
if(verbose>1)
{
- log_verbose("Reading sector %10lu/%lu\n",(unsigned long)((offset-partition->part_offset)/disk_car->sector_size),(unsigned long)((partition->part_size-1)/disk_car->sector_size));
+ log_verbose("Reading sector %10llu/%llu\n",
+ (unsigned long long)((offset-partition->part_offset)/disk_car->sector_size),
+ (unsigned long long)((partition->part_size-1)/disk_car->sector_size));
}
if(disk_car->pread(disk_car, buffer, READ_SIZE, offset) != READ_SIZE)
{
diff --git a/src/phnc.c b/src/phnc.c
index 7fcd32e..ec60777 100644
--- a/src/phnc.c
+++ b/src/phnc.c
@@ -94,13 +94,13 @@ int photorec_progressbar(WINDOW *window, const unsigned int pass, const photorec
{
wprintw(window, "Pass %u - ", pass);
if(status==STATUS_FIND_OFFSET)
- wprintw(window,"Reading sector %10lu/%lu, %u/10 headers found\n",
- (unsigned long)((offset-partition->part_offset)/disk_car->sector_size),
- (unsigned long)(partition->part_size/disk_car->sector_size), file_nbr);
+ wprintw(window,"Reading sector %10llu/%llu, %u/10 headers found\n",
+ (unsigned long long)((offset-partition->part_offset)/disk_car->sector_size),
+ (unsigned long long)(partition->part_size/disk_car->sector_size), file_nbr);
else
- wprintw(window,"Reading sector %10lu/%lu, %u files found\n",
- (unsigned long)((offset-partition->part_offset)/disk_car->sector_size),
- (unsigned long)(partition->part_size/disk_car->sector_size), file_nbr);
+ wprintw(window,"Reading sector %10llu/%llu, %u files found\n",
+ (unsigned long long)((offset-partition->part_offset)/disk_car->sector_size),
+ (unsigned long long)(partition->part_size/disk_car->sector_size), file_nbr);
}
wmove(window,10,0);
wclrtoeol(window);
diff --git a/src/phrecn.c b/src/phrecn.c
index 12e938e..6a725d5 100644
--- a/src/phrecn.c
+++ b/src/phrecn.c
@@ -209,7 +209,9 @@ static int photorec_aux(disk_t *disk_car, partition_t *partition, const int verb
info_list_search_space(list_search_space, current_search_space, disk_car->sector_size, 0, verbose);
if(verbose>1)
{
- log_verbose("Reading sector %10lu/%lu\n",(unsigned long)((offset-partition->part_offset)/disk_car->sector_size),(unsigned long)((partition->part_size-1)/disk_car->sector_size));
+ log_verbose("Reading sector %10llu/%llu\n",
+ (unsigned long long)((offset-partition->part_offset)/disk_car->sector_size),
+ (unsigned long long)((partition->part_size-1)/disk_car->sector_size));
}
disk_car->pread(disk_car, buffer, READ_SIZE, offset);
while(current_search_space!=list_search_space)
@@ -459,7 +461,9 @@ static int photorec_aux(disk_t *disk_car, partition_t *partition, const int verb
buffer=buffer_olddata + blocksize;
if(verbose>1)
{
- log_verbose("Reading sector %10lu/%lu\n",(unsigned long)((offset-partition->part_offset)/disk_car->sector_size),(unsigned long)((partition->part_size-1)/disk_car->sector_size));
+ log_verbose("Reading sector %10llu/%llu\n",
+ (unsigned long long)((offset-partition->part_offset)/disk_car->sector_size),
+ (unsigned long long)((partition->part_size-1)/disk_car->sector_size));
}
if(disk_car->pread(disk_car, buffer, READ_SIZE, offset) != READ_SIZE)
{
diff --git a/src/sessionp.c b/src/sessionp.c
index f45fc8f..9f643d1 100644
--- a/src/sessionp.c
+++ b/src/sessionp.c
@@ -122,8 +122,8 @@ int session_load(char **cmd_device, char **current_cmd, alloc_data_t *list_free_
*current_cmd=strdup(info);
while(1)
{
- long unsigned int start=0;
- long unsigned int end=0;
+ uint64_t start=0;
+ uint64_t end=0;
while(*pos>='0' && *pos<='9')
{
start=start*10 + (*pos - '0');
@@ -212,8 +212,9 @@ int session_save(alloc_data_t *list_free_space, disk_t *disk_car, const partitio
{
alloc_data_t *current_free_space;
current_free_space=td_list_entry(free_walker, alloc_data_t, list);
- fprintf(f_session,"%lu-%lu\n",(long unsigned)(current_free_space->start/disk_car->sector_size),
- (long unsigned)(current_free_space->end/disk_car->sector_size));
+ fprintf(f_session,"%llu-%llu\n",
+ (long long unsigned)(current_free_space->start/disk_car->sector_size),
+ (long long unsigned)(current_free_space->end/disk_car->sector_size));
}
}
{ /* Reserve some space */