]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-09-01 Vladimir Serbinenko <phcoder@gmail.com>
authorphcoder <phcoder@localhost>
Tue, 1 Sep 2009 19:07:42 +0000 (19:07 +0000)
committerphcoder <phcoder@localhost>
Tue, 1 Sep 2009 19:07:42 +0000 (19:07 +0000)
* commands/loadenv.c (check_blocklists): Fix off-by-one error.
(write_blocklists): Likewise.

ChangeLog
commands/loadenv.c

index 3fd3d2ec97760c0ca8c80504910019a4735e1015..d8c75dfabe33af7589090138750f7607f0ea39bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 22665f9fe20fa0cda79c9309018fa150e356874e..c60eb835c2c2a32800c75af76db0cb68ba346e5f 100644 (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))