diff options
author | Matthew Booth <mbooth@redhat.com> | 2012-01-18 17:33:42 +0000 |
---|---|---|
committer | Matthew Booth <mbooth@redhat.com> | 2012-01-20 15:29:08 +0000 |
commit | 3d80161d9c277c800a3214694ba56a8909e655df (patch) | |
tree | 6bddda83939c84a94e256b6affcd20103c7a5774 | |
parent | 24f01a581b0452cfc8d7239b6a556e4282b0b964 (diff) | |
download | libguestfs-3d80161d9c277c800a3214694ba56a8909e655df.tar.gz libguestfs-3d80161d9c277c800a3214694ba56a8909e655df.tar.xz libguestfs-3d80161d9c277c800a3214694ba56a8909e655df.zip |
c: Fix prototype generator when last argument is a BufferIn
We were passing the name of the last argument directly to va_start. However, if
the last argument is a BufferIn it expands to 2 arguments, the latter of which
is <name>_size.
-rw-r--r-- | generator/generator_c.ml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/generator/generator_c.ml b/generator/generator_c.ml index 35c0534b..7b73197c 100644 --- a/generator/generator_c.ml +++ b/generator/generator_c.ml @@ -1404,7 +1404,13 @@ trace_send_line (guestfs_h *g) | _ -> match args with | [] -> "g" - | args -> name_of_argt (List.hd (List.rev args)) in + | args -> + let last = List.hd (List.rev args) in + let name = name_of_argt last in + match last with + | BufferIn n -> name ^ "_size" + | _ -> name + in let rtype = match ret with |