asprintf and snprintf support
This commit is contained in:
parent
c181849b95
commit
8b442f3f4c
60 changed files with 396 additions and 345 deletions
|
@ -568,10 +568,9 @@ grub_xnu_register_memory (char *prefix, int *suffix,
|
|||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't register memory");
|
||||
if (suffix)
|
||||
{
|
||||
driverkey->name = grub_malloc (grub_strlen (prefix) + 10);
|
||||
driverkey->name = grub_asprintf ("%s%d", prefix, (*suffix)++);
|
||||
if (!driverkey->name)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't register memory");
|
||||
grub_sprintf (driverkey->name, "%s%d", prefix, (*suffix)++);
|
||||
}
|
||||
else
|
||||
driverkey->name = grub_strdup (prefix);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue