From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Sun, 20 Jan 2008 12:08:15 +0000 (+0000) Subject: Return UUID (packed byte array) correctly. X-Git-Tag: 1.0.4~52 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=cb83441a2e80b7e57ea0010ca010ea939b416506;p=virt-top.git Return UUID (packed byte array) correctly. --- diff --git a/libvirt/generator.pl b/libvirt/generator.pl index ad2069f..0a73264 100755 --- a/libvirt/generator.pl +++ b/libvirt/generator.pl @@ -562,7 +562,9 @@ sub gen_c_code NONBLOCKING (r = $c_name ($1, uuid)); CHECK_ERROR (r == -1, conn, \"$c_name\"); - rv = caml_copy_string ((char *) uuid); + /* UUIDs are byte arrays with a fixed length. */ + rv = caml_alloc_string (VIR_UUID_BUFLEN); + memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN); CAMLreturn (rv); " } elsif ($sig =~ /^(\w+) : uuid string$/) { @@ -886,7 +888,7 @@ foreach my $function (@functions) { print F <