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

Otavio Salvador otavio at debian.org
Wed May 30 23:12:52 UTC 2007


Jim Meyering <jim at meyering.net> writes:

> Otavio Salvador <otavio at debian.org> wrote:
>
>> 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?
>
> No.  First, "*part_table" as an argument to sizeof doesn't
> cause a dereference.  Rather it identifies the type that the
> sizeof operator operates on.

Ah, ok, great! :-)

Ack.

-- 
        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