From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Mif3d-0005uk-8h for mharc-grub-devel@gnu.org; Tue, 01 Sep 2009 21:54:45 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mif3c-0005uX-8j for grub-devel@gnu.org; Tue, 01 Sep 2009 21:54:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mif3W-0005qf-WA for grub-devel@gnu.org; Tue, 01 Sep 2009 21:54:43 -0400 Received: from [199.232.76.173] (port=38418 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mif3W-0005qB-NN for grub-devel@gnu.org; Tue, 01 Sep 2009 21:54:38 -0400 Received: from smarthost02.mail.zen.net.uk ([212.23.3.141]:47196) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mif3W-0006lG-7T for grub-devel@gnu.org; Tue, 01 Sep 2009 21:54:38 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1Mif3V-0006gD-KV for grub-devel@gnu.org; Wed, 02 Sep 2009 01:54:37 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1Mif3V-0005ni-00; Wed, 02 Sep 2009 02:54:37 +0100 Date: Wed, 2 Sep 2009 02:54:37 +0100 From: Colin Watson To: grub-devel@gnu.org Message-ID: <20090902015437.GA22283@riva.ucam.org> References: <20090902014939.GM13423@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090902014939.GM13423@riva.ucam.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost02-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] Introduce xasprintf X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2009 01:54:44 -0000 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 * 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 [cjwatson@ubuntu.com]