/[pupa]/pupa/fs/fat.c
ViewVC logotype

Diff of /pupa/fs/fat.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by okuji, Thu Jan 2 20:12:32 2003 UTC revision 1.3 by okuji, Thu Jan 2 23:46:21 2003 UTC
# Line 156  pupa_fat_mount (pupa_disk_t disk) Line 156  pupa_fat_mount (pupa_disk_t disk)
156    data = (struct pupa_fat_data *) pupa_malloc (sizeof (*data));    data = (struct pupa_fat_data *) pupa_malloc (sizeof (*data));
157    if (! data)    if (! data)
158      goto fail;      goto fail;
159      
160    /* Read the BPB.  */    /* Read the BPB.  */
161    if (pupa_disk_read (disk, 0, 0, sizeof (bpb), (char *) &bpb))    if (pupa_disk_read (disk, 0, 0, sizeof (bpb), (char *) &bpb))
162      goto fail;      goto fail;
# Line 437  pupa_fat_read_data (pupa_disk_t disk, st Line 437  pupa_fat_read_data (pupa_disk_t disk, st
437                break;                break;
438              case 12:              case 12:
439                if (data->cur_cluster & 1)                if (data->cur_cluster & 1)
440                  next_cluster >>= 12;                  next_cluster >>= 4;
441                                
442                next_cluster &= 0x0FFF;                next_cluster &= 0x0FFF;
443                break;                break;
444              }              }
445    
446    #if 0
447              pupa_printf ("%s:%d: fat_size=%d, next_cluster=%u\n",
448                           __FILE__, __LINE__, data->fat_size, next_cluster);
449    #endif
450              
451            /* Check the end.  */            /* Check the end.  */
452            if (next_cluster >= data->cluster_eof_mark)            if (next_cluster >= data->cluster_eof_mark)
453              return ret;              return ret;
454    
455            if (next_cluster < 2 || next_cluster >= data->num_clusters)            if (next_cluster < 2 || next_cluster >= data->num_clusters)
456              {              {
457                pupa_error (PUPA_ERR_BAD_FS, "invalid cluster");                pupa_error (PUPA_ERR_BAD_FS, "invalid cluster %u",
458                              next_cluster);
459                return -1;                return -1;
460              }              }
461    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26