about the length of drive names.
* conf/common.rmk (grub_probe_SOURCES): Add Sun partition module.
(grub_fstest_SOURCES): Likewise.
+ * util/hostdisk.c (make_device_name): Do not make any assumptions
+ about the length of drive names.
+
2009-04-12 David S. Miller <davem@davemloft.net>
* kern/misc.c (grub_ltoa): Fix cast when handling negative
static char *
make_device_name (int drive, int dos_part, int bsd_part)
{
+ int len = strlen(map[drive].drive);
char *p;
- p = xmalloc (30);
+ if (dos_part >= 0)
+ len += 1 + ((dos_part + 1) / 10);
+ if (bsd_part >= 0)
+ len += 2;
+
+ p = xmalloc (len);
sprintf (p, "%s", map[drive].drive);
if (dos_part >= 0)