This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix "list" when control characters are seen
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Tom Tromey <tromey at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 09 Apr 2019 21:24:28 +0200
- Subject: Re: [PATCH] Fix "list" when control characters are seen
- References: <20190409185432.16985-1-tromey@adacore.com>
On Apr 09 2019, Tom Tromey <tromey@adacore.com> wrote:
> diff --git a/gdb/source.c b/gdb/source.c
> index f99215f9810..b61880ab503 100644
> --- a/gdb/source.c
> +++ b/gdb/source.c
> @@ -1368,7 +1368,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline,
> char c = *iter;
> if (c == '\033' && skip_ansi_escape (iter, &skip_bytes))
> iter += skip_bytes;
> - else if (c < 040 && c != '\t')
> + else if (c >= 0 && c < 040 && c != '\t')
Does this give a warning when char is unsigned?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."