2009-12-07 Colin Watson <cjwatson@ubuntu.com>

* configure.ac: Check for vasprintf.
	* util/misc.c (asprintf): Move allocation from here ...
	(vasprintf): ... to here.  New function.
	(xasprintf): New function.
	* include/grub/util/misc.h (vasprintf, xasprintf): Add
	prototypes.
	* util/getroot.c (grub_util_get_grub_dev): Use xasprintf.
	* util/grub-mkfont.c (write_font): Likewise.
	* util/grub-probe.c (probe): Likewise.
	* util/hostdisk.c (make_device_name): Likewise.
This commit is contained in:
Colin Watson 2009-12-07 16:46:24 +00:00
parent de6daa8b56
commit d6ceebf1d9
9 changed files with 68 additions and 18 deletions

View file

@ -254,7 +254,7 @@ probe (const char *path, char *device_name)
filebuf_via_sys = grub_util_read_image (path);
rel_path = make_system_path_relative_to_its_root (path);
asprintf (&grub_path, "(%s)%s", drive_name, rel_path);
grub_path = xasprintf ("(%s)%s", drive_name, rel_path);
free (rel_path);
grub_util_info ("reading %s via GRUB facilities", grub_path);
file = grub_file_open (grub_path);