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.
This commit is contained in:
		
							parent
							
								
									020616c2b2
								
							
						
					
					
						commit
						e15199cb7b
					
				
					 3 changed files with 18 additions and 8 deletions
				
			
		|  | @ -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"); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue