Changeset b06414f in mainline for uspace/srv/fs/fat/fat_directory.c


Ignore:
Timestamp:
2017-05-19T14:04:36Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e540bc87
Parents:
2628642
Message:

Use proper sizes for buffers holding conversions from/to UTF-16 LFN's

FAT uses UTF-16 for encoding long file names. HelenOS needs to convert
these strings into and from its native UTF-8 encoding. The size of the
UTF-8 buffer in bytes needs to be at least 4 times the number of
characters in a LFN.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_directory.c

    r2628642 rb06414f  
    155155{
    156156        fat_dentry_t *d = NULL;
    157         uint16_t wname[FAT_LFN_NAME_SIZE];
     157        uint16_t wname[FAT_LFN_NAME_LEN];
    158158        size_t lfn_offset, lfn_size;
    159159        bool long_entry = false;
     
    293293                int long_entry_count;
    294294                uint8_t checksum;
    295                 uint16_t wname[FAT_LFN_NAME_SIZE];
     295                uint16_t wname[FAT_LFN_NAME_LEN];
    296296                size_t lfn_size, lfn_offset;
    297297               
    298                 rc = str_to_utf16(wname, FAT_LFN_NAME_SIZE, name);
     298                rc = str_to_utf16(wname, FAT_LFN_NAME_LEN, name);
    299299                if (rc != EOK)
    300300                        return rc;
Note: See TracChangeset for help on using the changeset viewer.