diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-01-21 02:23:33 +0300 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-01-23 09:56:53 +0300 |
commit | 041f0af3668e037f465d0e80ea5561fb3fbaa7d0 (patch) | |
tree | 00d9220bfa7564f6e37e6aef0b71524737aa8a19 /include | |
parent | e97eb638de0dc8f6e989e20eaeb0342f103cb917 (diff) | |
download | u-boot-041f0af3668e037f465d0e80ea5561fb3fbaa7d0.tar.xz |
fs: fat: structure for name and extension
The short name and extension of FAT files are stored in adjacent fields of
the directory entry. For some operations like calculating a checksum or
copying both fields it is preferable to treat both as one structure.
Change the definition of the directory entry structure to include a
structure comprising the name and the extension field.
This resolves Coverity CID 316357, CID 316350, CID 316348.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/fat.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/fat.h b/include/fat.h index b9f273f381..bd8e450b33 100644 --- a/include/fat.h +++ b/include/fat.h @@ -132,8 +132,13 @@ typedef struct volume_info #define CASE_LOWER_BASE 8 /* base (name) is lower case */ #define CASE_LOWER_EXT 16 /* extension is lower case */ +struct nameext { + char name[8]; + char ext[3]; +}; + typedef struct dir_entry { - char name[8],ext[3]; /* Name and extension */ + struct nameext nameext; /* Name and extension */ __u8 attr; /* Attribute bits */ __u8 lcase; /* Case for name and ext (CASE_LOWER_x) */ __u8 ctime_ms; /* Creation time, milliseconds */ |