On Wed, Sep 02, 2009 at 02:49:39AM +0100, Colin Watson wrote:
> I came across the idea of an xasprintf function in Gnulib a while back.
> Using this both fixes the above class of warnings by always checking the
> return value of asprintf, and also provides an IMO more intuitive
> interface to formatting an allocated string. Do people like the
> following patch? The warnings are minor so there's no problem with this
> being post-1.97.

Sorry, I forgot to supply a ChangeLog entry for this.

2009-09-02  Colin Watson  <cjwat...@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.

-- 
Colin Watson                                       [cjwat...@ubuntu.com]


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to