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

@ -107,7 +107,7 @@ create_envblk_file (const char *name)
if (! buf)
grub_util_error ("out of memory");
asprintf (&namenew, "%s.new", name);
namenew = xasprintf ("%s.new", name);
fp = fopen (namenew, "wb");
if (! fp)
grub_util_error ("cannot open the file %s", namenew);