[PATCH] Fix asprintf warning in DevicePool

# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1193504300 25200 # Node ID b00e3353ccec10cdd9c3e6882067b2b73a5bd448 # Parent aaad430ea766d9a3bc0be035e595d8da17ee2122 Fix asprintf warning in DevicePool This fixes the compile warning (error) that was preventing a compile on Fedora 7. Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r aaad430ea766 -r b00e3353ccec src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Fri Oct 26 13:34:26 2007 -0700 +++ b/src/Virt_DevicePool.c Sat Oct 27 09:58:20 2007 -0700 @@ -70,9 +70,11 @@ static char *netpool_member_of(const CMP for (i = 0; i < count; i++) { if (STREQ((devs[i].id), dev)) { - asprintf(&result, - "NetworkPool/%s", - devs[i].dev.net.bridge); + ret = asprintf(&result, + "NetworkPool/%s", + devs[i].dev.net.bridge); + if (ret == -1) + result = NULL; break; } }

On Sat, Oct 27, 2007 at 09:59:16AM -0700, Dan Smith wrote:
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1193504300 25200 # Node ID b00e3353ccec10cdd9c3e6882067b2b73a5bd448 # Parent aaad430ea766d9a3bc0be035e595d8da17ee2122 Fix asprintf warning in DevicePool This fixes the compile warning (error) that was preventing a compile on Fedora 7.
Signed-off-by: Dan Smith <danms@us.ibm.com>
Looks fine to me, +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (2)
-
Dan Smith
-
Daniel Veillard