aboutsummaryrefslogtreecommitdiff
path: root/block-vvfat.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2009-04-25 00:08:05 +0200
committerAurelien Jarno <aurelien@aurel32.net>2009-04-25 00:08:05 +0200
commit5606c2208b1cbae32ff387bf0a102cb88e5065a3 (patch)
tree9c3d1589967d0c08c06a569b828f213179c21617 /block-vvfat.c
parentd6dc3d424e26b49e1f37f1ef2598eacf3bc4eac7 (diff)
block-vvfat: fix a warning
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'block-vvfat.c')
-rw-r--r--block-vvfat.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/block-vvfat.c b/block-vvfat.c
index 429c37c5e7..79059311c6 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -509,9 +509,12 @@ static inline uint8_t fat_chksum(const direntry_t* entry)
uint8_t chksum=0;
int i;
- for(i=0;i<11;i++)
- chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0))
- +(unsigned char)entry->name[i];
+ for(i=0;i<11;i++) {
+ unsigned char c;
+
+ c = (i <= 8) ? entry->name[i] : entry->extension[i-8];
+ chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0)) + c;
+ }
return chksum;
}