diff options
author | Marek Vasut <marex@denx.de> | 2012-10-09 07:20:22 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-10-17 07:59:11 -0700 |
commit | ff04f6d1224d8952b566b8671222151495883073 (patch) | |
tree | 4e051700ef3ed9e26ef23496e63a2b46b1581e46 /fs/fat/fat_write.c | |
parent | e2e9b37898c4d9f7330ce256d95a37da5064e0cf (diff) |
fs: fat: Fix mkcksum() function parameters
The mkcksum() function now takes one parameter, the pointer to
11-byte wide character array, which it then operates on.
Currently, the function is wrongly passed (dir_entry)->name, which
is only 8-byte wide character array. Though by further inspecting
the dir_entry structure, it can be noticed that the name[8] entry
is immediatelly followed by ext[3] entry. Thus, name[8] and ext[3]
in the dir_entry structure actually work as this 11-byte wide array
since they're placed right next to each other by current compiler
behavior.
Depending on this is obviously wrong, thus fix this by correctly
passing both (dir_entry)->name and (dir_entry)->ext to the mkcksum()
function and adjust the function appropriately.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
Diffstat (limited to 'fs/fat/fat_write.c')
-rw-r--r-- | fs/fat/fat_write.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c index 5829adf1a1..4a1bda0a37 100644 --- a/fs/fat/fat_write.c +++ b/fs/fat/fat_write.c @@ -335,7 +335,7 @@ fill_dir_slot(fsdata *mydata, dir_entry **dentptr, const char *l_name) /* Get short file name and checksum value */ strncpy(s_name, (*dentptr)->name, 16); - checksum = mkcksum(s_name); + checksum = mkcksum((*dentptr)->name, (*dentptr)->ext); do { memset(slotptr, 0x00, sizeof(dir_slot)); |