Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-exfat: Commit

external/exfat


Commit MetaInfo

Revision4e6606bb5ffa39fbe72f0321ce7eb0ee27deb49f (tree)
Time2020-05-05 00:53:09
Authorrelan <relan@user...>
Commiterrelan

Log Message

Fix cluster bitmap traversal on big endian machines.

We define bitmap_t to unsigned char on big endian systems to avoid byte
order conversions. But bitwise complement causes integer promotion and
makes the condition always false. Truncate the result after complementing
zero.

Change Summary

Incremental Difference

--- a/libexfat/cluster.c
+++ b/libexfat/cluster.c
@@ -122,7 +122,7 @@ static cluster_t find_bit_and_set(bitmap_t* bitmap, size_t start, size_t end)
122122
123123 for (i = start_index; i < end_index; i++)
124124 {
125- if (bitmap[i] == ~((bitmap_t) 0))
125+ if (bitmap[i] == (bitmap_t) ~((bitmap_t) 0))
126126 continue;
127127 start_bitindex = MAX(i * sizeof(bitmap_t) * 8, start);
128128 end_bitindex = MIN((i + 1) * sizeof(bitmap_t) * 8, end);
Show on old repository browser