diff options
author | Petr Machata <pmachata@redhat.com> | 2012-01-06 18:34:22 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-08-29 19:02:06 +0200 |
commit | d7b2292789462475ead5986c2dea25a0b8623f7d (patch) | |
tree | 28de342cd5347058d7c7aa83cb31d17d305c3b7a /display_args.c | |
parent | eff655b78f3f5d9119faa93461787192cf57dab0 (diff) | |
download | ltrace-d7b2292789462475ead5986c2dea25a0b8623f7d.tar.gz |
Add module zero.c/zero.h
Diffstat (limited to 'display_args.c')
-rw-r--r-- | display_args.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/display_args.c b/display_args.c index 4a1747d..82f4385 100644 --- a/display_args.c +++ b/display_args.c @@ -34,6 +34,7 @@ #include "expr.h" #include "type.h" #include "common.h" +#include "zero.h" #define READER(NAME, TYPE) \ static int \ @@ -272,9 +273,8 @@ format_array(FILE *stream, struct value *value, struct value_dict *arguments, * space. */ typedef char assert__long_enough_long[-(sizeof(long) < sizeof(void *))]; long l = options.strlen; - if (length != NULL) /* XXX emulate node ZERO before it lands */ - if (expr_eval_word(length, value, arguments, &l) < 0) - return -1; + if (expr_eval_word(length, value, arguments, &l) < 0) + return -1; size_t len = (size_t)l; int written = 0; @@ -295,8 +295,6 @@ format_array(FILE *stream, struct value *value, struct value_dict *arguments, struct value element; if (value_init_element(&element, value, i) < 0) return -1; - if (value_is_zero(&element, arguments)) /* XXX emulate ZERO */ - break; int o = format_argument(stream, &element, arguments); if (o < 0) return -1; @@ -313,7 +311,7 @@ format_array(FILE *stream, struct value *value, struct value_dict *arguments, int format_argument(FILE *stream, struct value *value, struct value_dict *arguments) { - struct expr_node *length = NULL; + struct expr_node *length = expr_node_zero(); switch (value->type->type) { case ARGTYPE_VOID: return fprintf(stream, "<void>"); |