]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2004-07-11 Marco Gerards <metgerards@student.han.nl>
authormarco_g <marco_g@localhost>
Sun, 11 Jul 2004 14:24:54 +0000 (14:24 +0000)
committermarco_g <marco_g@localhost>
Sun, 11 Jul 2004 14:24:54 +0000 (14:24 +0000)
* disk/powerpc/ieee1275/partition.c (grub_partition_iterate): Skip
one block instead of two when looking for the initial partition.
(grub_partition_probe): Initialize the local variable `p' with 0.
Use base 10 for the grub_strtoul call.
* kern/misc.c (grub_strncpy): Fix off by one bug.  Eliminated the
need for one local variable.
(grub_strtoul): Don't add the new value to `num', instead of that
just assign it.

ChangeLog
disk/powerpc/ieee1275/partition.c
kern/misc.c

index 081386a804cae2913800b3ab38ed630d28b8b3e4..36c3c5e76f9eadc43c0429394b9dace57f781062 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-07-11  Marco Gerards  <metgerards@student.han.nl>
+
+       * disk/powerpc/ieee1275/partition.c (grub_partition_iterate): Skip
+       one block instead of two when looking for the initial partition.
+       (grub_partition_probe): Initialize the local variable `p' with 0.
+       Use base 10 for the grub_strtoul call.
+       * kern/misc.c (grub_strncpy): Fix off by one bug.  Eliminated the
+       need for one local variable.
+       (grub_strtoul): Don't add the new value to `num', instead of that
+       just assign it.
+
 2004-07-11  Marco Gerards  <metgerards@student.han.nl>
 
        * conf/i386-pc.rmk (pkgdata_IMAGE): Add pxeboot.img.
index 0a48a84127b1d3ba7ac464517436e73516a942e7..9664bf00e5bcdc28cdaf2483556aa9c519c34d13 100644 (file)
@@ -31,7 +31,7 @@ grub_partition_iterate (grub_disk_t disk,
   struct grub_apple_part apart;
   struct grub_disk raw;
   int partno = 0;
-  int pos = GRUB_DISK_SECTOR_SIZE * 2;
+  int pos = GRUB_DISK_SECTOR_SIZE;
 
   /* Enforce raw disk access.  */
   raw = *disk;
@@ -68,7 +68,7 @@ grub_partition_iterate (grub_disk_t disk,
 grub_partition_t
 grub_partition_probe (grub_disk_t disk, const char *str)
 {
-  grub_partition_t p;
+  grub_partition_t p = 0;
   int partnum = 0;
   char *s = (char *) str;
 
@@ -88,7 +88,7 @@ grub_partition_probe (grub_disk_t disk, const char *str)
     }
   
   /* Get the partition number.  */
-  partnum = grub_strtoul (s, &s, 0);
+  partnum = grub_strtoul (s, 0, 10);
   if (grub_errno)
     {
       grub_error (GRUB_ERR_BAD_FILENAME, "invalid partition");
index 8fe9913a3afac1a88887bc49c6781e466cce692b..28a6b63a642f98dfd0e276243bb940cadea6a99a 100644 (file)
@@ -64,10 +64,9 @@ char *
 grub_strncpy (char *dest, const char *src, int c)
 {
   char *p = dest;
-  int pos = 0;
-
-  while ((*p++ = *src++) != '\0' && c > pos)
-    pos++;
+  
+  while ((*p++ = *src++) != '\0' && --c)
+    ;
 
   return dest;
 }
@@ -285,7 +284,7 @@ grub_strtoul (const char *str, char **end, int base)
          return 0;
        }
 
-      num += num * base + digit;
+      num = num * base + digit;
       str++;
     }