From: Eugene Syromyatnikov Date: Sat, 26 Aug 2017 22:42:55 +0000 (+0200) Subject: term: use print_quoted_string X-Git-Tag: v4.19~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=baabc1772567455a558a63de4b230b7be5a9bbeb;p=strace term: use print_quoted_string * term.c (decode_termios): Use print_quoted_string for printing c_cc field instead of writing the printing code by hand. --- diff --git a/term.c b/term.c index 6a7a65b8..9a5d62d9 100644 --- a/term.c +++ b/term.c @@ -42,7 +42,6 @@ static void decode_termios(struct tcb *const tcp, const kernel_ulong_t addr) { struct termios tios; - int i; tprints(", "); if (umove_or_printaddr(tcp, addr, &tios)) @@ -65,10 +64,9 @@ decode_termios(struct tcb *const tcp, const kernel_ulong_t addr) if (!(tios.c_lflag & ICANON)) tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ", tios.c_cc[VMIN], tios.c_cc[VTIME]); - tprints("c_cc=\""); - for (i = 0; i < NCCS; i++) - tprintf("\\x%02x", tios.c_cc[i]); - tprints("\"}"); + tprints("c_cc="); + print_quoted_string((char *) tios.c_cc, NCCS, QUOTE_FORCE_HEX); + tprints("}"); } static void