diff options
author | Matthew Booth <mbooth@redhat.com> | 2012-01-18 17:33:42 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-01-23 18:16:15 +0000 |
commit | e80cb70b33eab48f3176b887ddb2d415a8957459 (patch) | |
tree | a45c4ccab2a729620fff55a548301f6a779ae69d | |
parent | 111761d6c4f200d1eced51cceffcb941bbb68255 (diff) | |
download | libguestfs-e80cb70b33eab48f3176b887ddb2d415a8957459.tar.gz libguestfs-e80cb70b33eab48f3176b887ddb2d415a8957459.tar.xz libguestfs-e80cb70b33eab48f3176b887ddb2d415a8957459.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.
(cherry picked from commit 3d80161d9c277c800a3214694ba56a8909e655df)
-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 e9fe89b6..51bcf849 100644 --- a/generator/generator_c.ml +++ b/generator/generator_c.ml @@ -1400,7 +1400,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 |