summaryrefslogtreecommitdiffstats
path: root/src/parti386.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-05-05 13:13:14 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2009-05-05 13:13:14 +0200
commit9d0ddd4ce3471d1f8c15845684df8c19b4876c7c (patch)
treef64678a1ce0a61b7847b980377d3b441704e89e6 /src/parti386.c
parent8a36ff31fdfeee2ddbb3004f9157de7c3dbb42e4 (diff)
Limit the scope of several variables
Diffstat (limited to 'src/parti386.c')
-rw-r--r--src/parti386.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parti386.c b/src/parti386.c
index d69be54..a6f1982 100644
--- a/src/parti386.c
+++ b/src/parti386.c
@@ -483,12 +483,12 @@ static list_part_t *get_ext_data_i386(disk_t *disk_car, list_part_t *list_part,
{
partition_t *partition_ext=partition_main_ext;
partition_t *partition_next_ext=NULL;
- unsigned int i;
unsigned int order=5;
do
{
unsigned char buffer[DEFAULT_SECTOR_SIZE];
int nb_hidden=0, nb_mb=0, nb_part=0, nb_ext=0, nb_boot=0;
+ unsigned int i;
if(disk_car->pread(disk_car, &buffer, sizeof(buffer), partition_ext->part_offset) != sizeof(buffer))
return list_part;
if((buffer[0x1FE]!=(unsigned char)0x55)||(buffer[0x1FF]!=(unsigned char)0xAA))
@@ -777,7 +777,6 @@ static int write_all_log_i386(disk_t *disk_car, const list_part_t *list_part, co
{
for(element=pos_ext->next;(element!=NULL) && (element->part->status==STATUS_LOG);element=element->next)
{
- int j;
unsigned char buffer[DEFAULT_SECTOR_SIZE];
unsigned char buffer_org[DEFAULT_SECTOR_SIZE];
if(verbose>0)
@@ -839,6 +838,7 @@ static int write_all_log_i386(disk_t *disk_car, const list_part_t *list_part, co
{
if(verbose>1)
{
+ int j;
for(j=0;j<4;j++)
{
const struct partition_dos *p=pt_offset(buffer,j);
@@ -864,9 +864,9 @@ static int write_all_log_i386(disk_t *disk_car, const list_part_t *list_part, co
static int diff(const unsigned char buffer[DEFAULT_SECTOR_SIZE], const unsigned char buffer_org[DEFAULT_SECTOR_SIZE])
{
- int j;
if(memcmp(buffer,buffer_org,DEFAULT_SECTOR_SIZE))
{
+ int j;
log_info("\nSectors are different.\n");
log_info("buffer_org\n");
for(j=0;j<4;j++)