Ticket #4602: dosfs_volume_name.diff

File dosfs_volume_name.diff, 936 bytes (added by romain, 15 years ago)

Do not change volume label case in fs_stat

  • dosfs.c

     
    994994dosfs_read_fs_stat(fs_volume *_vol, struct fs_info * fss)
    995995{
    996996    nspace* vol = (nspace*)_vol->private_volume;
    997     int i;
    998997
    999998    LOCK_VOL(vol);
    1000999
     
    10211020    strncpy(fss->device_name, vol->device, sizeof(fss->device_name));
    10221021
    10231022    if (vol->vol_entry > -2)
    1024         strncpy(fss->volume_name, vol->vol_label, sizeof(fss->volume_name));
     1023        strlcpy(fss->volume_name, vol->vol_label, sizeof(fss->volume_name));
    10251024    else
    10261025        strcpy(fss->volume_name, "no name");
    10271026
    1028     // XXX: should sanitize name as well
    1029     for (i=10;i>0;i--)
    1030         if (fss->volume_name[i] != ' ')
    1031             break;
    1032     fss->volume_name[i+1] = 0;
    1033     for (;i>=0;i--) {
    1034         if ((fss->volume_name[i] >= 'A') && (fss->volume_name[i] <= 'Z'))
    1035             fss->volume_name[i] += 'a' - 'A';
    1036     }
    1037 
    10381027    // File system name
    10391028    strcpy(fss->fsh_name, "fat");
    10401029