Fix a cache retrieving bug

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-04-24 14:52:00 +02:00
parent d8a2bcf564
commit 0c512b092c

View file

@ -571,7 +571,8 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
if (data)
{
grub_memcpy (buf, data, GRUB_DISK_CACHE_SIZE);
grub_memcpy (buf, data,
GRUB_DISK_CACHE_SIZE << GRUB_DISK_SECTOR_BITS);
sector += GRUB_DISK_CACHE_SIZE;
buf = (char *) buf + (GRUB_DISK_CACHE_SIZE << GRUB_DISK_SECTOR_BITS);
size -= (GRUB_DISK_CACHE_SIZE << GRUB_DISK_SECTOR_BITS);