2009-09-01 Vladimir Serbinenko <phcoder@gmail.com>

* commands/loadenv.c (check_blocklists): Fix off-by-one error.
	(write_blocklists): Likewise.
This commit is contained in:
phcoder 2009-09-01 19:07:42 +00:00
parent 3e81e9369b
commit aa0f752dfe
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2009-09-01 Vladimir Serbinenko <phcoder@gmail.com>
* commands/loadenv.c (check_blocklists): Fix off-by-one error.
(write_blocklists): Likewise.
2009-09-01 Colin Watson <cjwatson@ubuntu.com>
* script/lua/grub_lua.h (fputs): Supply a format string as the first

View file

@ -242,7 +242,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
part_start = 0;
buf = grub_envblk_buffer (envblk);
for (p = blocklists, index = 0; p; p = p->next, index += p->length)
for (p = blocklists, index = 0; p; index += p->length, p = p->next)
{
char blockbuf[GRUB_DISK_SECTOR_SIZE];
@ -278,7 +278,7 @@ write_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
part_start = 0;
index = 0;
for (p = blocklists; p; p = p->next, index += p->length)
for (p = blocklists; p; index += p->length, p = p->next)
{
if (grub_disk_write (disk, p->sector - part_start,
p->offset, p->length, buf + index))