projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f3047e6
)
block-vvfat: fix a warning
author
Aurelien Jarno
<aurelien@aurel32.net>
Fri, 24 Apr 2009 22:08:05 +0000
(
00:08
+0200)
committer
Aurelien Jarno
<aurelien@aurel32.net>
Fri, 24 Apr 2009 22:08:05 +0000
(
00:08
+0200)
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
block-vvfat.c
patch
|
blob
|
history
diff --git
a/block-vvfat.c
b/block-vvfat.c
index 429c37c5e7f5bf623eef5867e1cde73a0286c014..79059311c6dabf23e7c4efb20c2fa4ade08f9376 100644
(file)
--- 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;
}