For string types in printf.c, return a pointer to array, not array
Though ltrace currently translates the latter to the former, this is the
actual proper parameter type.
Also fix one prototype in test suite for the same reason.
diff --git a/printf.c b/printf.c
index 30187c6..97e2c2d 100644
--- a/printf.c
+++ b/printf.c
@@ -121,6 +121,10 @@
if (format_type == ARGTYPE_ARRAY) {
+ struct arg_type_info *array = malloc(sizeof(*array));
+ if (array == NULL)
+ return -1;
+
struct expr_node *node = NULL;
int own_node;
if (len_buf_len != 0
@@ -133,6 +137,7 @@
if (len == NULL) {
fail:
free(len);
+ free(array);
return -1;
}
@@ -157,10 +162,11 @@
node = expr_node_zero();
own_node = 0;
}
-
assert(node != NULL);
- type_init_array(infop, elt_info, 0, node, own_node);
+ type_init_array(array, elt_info, 0, node, own_node);
+ type_init_pointer(infop, array, 1);
+
} else if (format_type == ARGTYPE_POINTER) {
type_init_pointer(infop, elt_info, 1);