[parted-devel] [PATCH] Read an msdos partition table from a device with 2K sectors.

Otavio Salvador otavio at debian.org
Wed May 30 22:25:25 UTC 2007


Jim Meyering <jim at meyering.net> writes:

>  static int
>  msdos_probe (const PedDevice *dev)
>  {
>  	PedDiskType*	disk_type;
> -	DosRawTable	part_table;
> +	DosRawTable*	part_table;
>  	int		i;
>
>  	PED_ASSERT (dev != NULL, return 0);
>
> -        if (dev->sector_size != 512)
> +        if (dev->sector_size < sizeof *part_table)
>                  return 0;

Shouldn't it be sizeof(DosRawTable)? part_table points to a unkown
place at this point or am I missing something?

> -	if (!ped_device_read (dev, &part_table, 0, 1))
> +	char *label;
> +	if (!read_sector (dev, 0, &label))
>  		return 0;
>
> +        part_table = (DosRawTable *) label;
> +

Please, fix this indent to follow rest of file "standard" :(

-- 
        O T A V I O    S A L V A D O R
---------------------------------------------
 E-mail: otavio at debian.org      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
 you the whole house."



More information about the parted-devel mailing list