wok-current rev 17442
qemu/cloop: fix V0-V2
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Dec 10 21:59:12 2014 +0100 (2014-12-10) |
parents | ea94058cfe7f |
children | 1f94f879d67c |
files | qemu/stuff/cloop.u |
line diff
1.1 --- a/qemu/stuff/cloop.u Tue Dec 09 18:22:52 2014 +0100 1.2 +++ b/qemu/stuff/cloop.u Wed Dec 10 21:59:12 2014 +0100 1.3 @@ -30,7 +30,7 @@ 1.4 + // return (char *) "128BE accelerated knoppix 1.0"; 1.5 + } 1.6 + else { /* V2.0 */ 1.7 -+ uint64_t last = be64_to_cpu(ofs64[n]); 1.8 ++ uint64_t last = be64_to_cpu(ofs64[n - 1]); 1.9 + while (n--) { 1.10 + offsets[n].size = last - 1.11 + (offsets[n].offset = be64_to_cpu(ofs64[n])); 1.12 @@ -40,7 +40,7 @@ 1.13 + } 1.14 + } 1.15 + else if (ofs32[1] == 0) { /* V1.0 */ 1.16 -+ uint64_t last = le64_to_cpu(ofs64[n]); 1.17 ++ uint64_t last = le64_to_cpu(ofs64[n - 1]); 1.18 + while (n--) { 1.19 + offsets[n].size = last - 1.20 + (offsets[n].offset = le64_to_cpu(ofs64[n])); 1.21 @@ -49,7 +49,7 @@ 1.22 + // return (char *) "64LE v1.0"; 1.23 + } 1.24 + else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */ 1.25 -+ uint64_t last = ntohl(ofs32[n]); 1.26 ++ uint64_t last = ntohl(ofs32[n - 1]); 1.27 + while (n--) { 1.28 + offsets[n].size = last - 1.29 + (offsets[n].offset = ntohl(ofs32[n]));