Hello Grub developers,

kernel.c in docs/ (and the corresponding texi file) has a small mistake:
in the loop that's supposed to iterate over all the modules,
sizeof(module_t) is added to mod. But mod is already a pointer to
module_t! 

The (trivial) patch is attached.

Enjoy,

Stefanus

-- 
Stefanus Du Toit <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
  Computer Graphics Lab, University of Waterloo
  My e-mail may be flaky over the next little while. If you're having
  trouble getting through to me, e-mail [EMAIL PROTECTED]
? grub-example.patch
Index: ChangeLog
===================================================================
RCS file: /cvsroot/grub/grub/ChangeLog,v
retrieving revision 1.615
diff -u -r1.615 ChangeLog
--- ChangeLog   20 Sep 2004 21:55:00 -0000      1.615
+++ ChangeLog   27 Sep 2004 22:05:01 -0000
@@ -1,3 +1,9 @@
+2004-09-27  Stefanus Du Toit  <[EMAIL PROTECTED]>
+
+       * docs/kernel.c.texi (cmain): Incremement mod by one, instead of
+       sizeof(module_t), since it's already a pointer of type module_t.
+       * docs/kernel.c (cmain): Do the same.
+
 2004-09-20  Yoshinori K. Okuji  <[EMAIL PROTECTED]>
 
        * docs/internals.texi (Internals): Changed to an appendix.
Index: docs/kernel.c
===================================================================
RCS file: /cvsroot/grub/grub/docs/kernel.c,v
retrieving revision 1.3
diff -u -r1.3 kernel.c
--- docs/kernel.c       11 Jan 2001 07:28:16 -0000      1.3
+++ docs/kernel.c       27 Sep 2004 22:05:01 -0000
@@ -93,7 +93,7 @@
              (int) mbi->mods_count, (int) mbi->mods_addr);
       for (i = 0, mod = (module_t *) mbi->mods_addr;
           i < mbi->mods_count;
-          i++, mod += sizeof (module_t))
+          i++, mod++)
        printf (" mod_start = 0x%x, mod_end = 0x%x, string = %s\n",
                (unsigned) mod->mod_start,
                (unsigned) mod->mod_end,
Index: docs/kernel.c.texi
===================================================================
RCS file: /cvsroot/grub/grub/docs/kernel.c.texi,v
retrieving revision 1.3
diff -u -r1.3 kernel.c.texi
--- docs/kernel.c.texi  11 Jan 2001 07:28:16 -0000      1.3
+++ docs/kernel.c.texi  27 Sep 2004 22:05:01 -0000
@@ -93,7 +93,7 @@
               (int) mbi->mods_count, (int) mbi->mods_addr);
       for (i = 0, mod = (module_t *) mbi->mods_addr;
            i < mbi->mods_count;
-           i++, mod += sizeof (module_t))
+           i++, mod++)
         printf (" mod_start = 0x%x, mod_end = 0x%x, string = %s\n",
                 (unsigned) mod->mod_start,
                 (unsigned) mod->mod_end,
_______________________________________________
Bug-grub mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-grub

Reply via email to