[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [COMMIT 9c3d158] block-vvfat: fix a warning
From: |
Anthony Liguori |
Subject: |
[Qemu-commits] [COMMIT 9c3d158] block-vvfat: fix a warning |
Date: |
Mon, 27 Apr 2009 21:12:24 -0000 |
From: Aurelien Jarno <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
diff --git a/block-vvfat.c b/block-vvfat.c
index 429c37c..7905931 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;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [COMMIT 9c3d158] block-vvfat: fix a warning,
Anthony Liguori <=