aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-valprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/p-valprint.c')
-rw-r--r--gdb/p-valprint.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 3456fe4..69bfeba 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -105,13 +105,16 @@ pascal_language::value_print_inner (struct value *val,
elements up to it. */
if (options->stop_print_at_null)
{
+ unsigned int print_max_chars
+ = get_print_max_chars (options);
unsigned int temp_len;
/* Look for a NULL char. */
for (temp_len = 0;
- extract_unsigned_integer (valaddr + temp_len * eltlen,
- eltlen, byte_order)
- && temp_len < len && temp_len < options->print_max;
+ (extract_unsigned_integer
+ (valaddr + temp_len * eltlen, eltlen, byte_order)
+ && temp_len < len
+ && temp_len < print_max_chars);
temp_len++);
len = temp_len;
}