From 5606c2208b1cbae32ff387bf0a102cb88e5065a3 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sat, 25 Apr 2009 00:08:05 +0200 Subject: block-vvfat: fix a warning Signed-off-by: Aurelien Jarno --- block-vvfat.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'block-vvfat.c') 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; } -- cgit v1.2.3