[parted-devel] FAT_TYPE_FAT12 not handled in many switches

David Cantrell dcantrell at redhat.com
Fri Feb 16 16:41:41 CET 2007


On Fri, 2007-02-16 at 15:20 +0100, Jim Meyering wrote:
> David Cantrell <dcantrell at redhat.com> wrote:
> >> Two examples:
> >> ==========================================
> >>
> >> static int
> >> _test_code_bad (const FatTable* ft, FatCluster code)
> >> {
> >> 	switch (ft->fat_type) {
> >> 		case FAT_TYPE_FAT16:
> >> 		if (code == 0xfff7) return 1;
> >> 		break;
> >>
> >> 		case FAT_TYPE_FAT32:
> >> 		if (code == 0x0ffffff7) return 1;
> >> 		break;
> >> 	}
> >> 	return 0;
> >> }
> 
> Thanks again for the pointers.
> 
> > Add:
> >
> > case FAT_TYPE_FAT12:
> > if (code == 0xff0) return 1;
> 
> Hmm...
> it looks like doc/FAT is saying to use 0xff7 there:
> 
>     * bad cluster (0xff7 for FAT12, 0xfff7 for FAT16, 0x0ffffff7 for FAT32).
>     Indicates the disk is physically damaged where the cluster is stored.

Yep, my mistake.  Sorry about that.

-- 
David Cantrell <dcantrell at redhat.com>
Red Hat / Westford, MA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20070216/53ca4918/attachment-0001.pgp


More information about the parted-devel mailing list