summaryrefslogtreecommitdiff
path: root/include/fat.h
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2021-01-21 00:23:33 +0100
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2021-01-23 07:56:53 +0100
commit041f0af3668e037f465d0e80ea5561fb3fbaa7d0 (patch)
tree00d9220bfa7564f6e37e6aef0b71524737aa8a19 /include/fat.h
parente97eb638de0dc8f6e989e20eaeb0342f103cb917 (diff)
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/fat.h')
-rw-r--r--include/fat.h7
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 */