Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libcurses/director tests/libcurses: on errors, pri...



details:   https://anonhg.NetBSD.org/src/rev/f02b72980c32
branches:  trunk
changeset: 959335:f02b72980c32
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Feb 08 19:00:22 2021 +0000

description:
tests/libcurses: on errors, print nonprintable characters as well

diffstat:

 tests/lib/libcurses/director/director.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r fe7dbefb72e4 -r f02b72980c32 tests/lib/libcurses/director/director.c
--- a/tests/lib/libcurses/director/director.c   Mon Feb 08 09:31:05 2021 +0000
+++ b/tests/lib/libcurses/director/director.c   Mon Feb 08 19:00:22 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: director.c,v 1.14 2021/02/07 13:56:23 rillig Exp $     */
+/*     $NetBSD: director.c,v 1.15 2021/02/08 19:00:22 rillig Exp $     */
 
 /*-
  * Copyright 2009 Brett Lymn <blymn%NetBSD.org@localhost>
@@ -84,8 +84,11 @@
        if (saved_output.count > 0) {
                fprintf(stderr, "output from slave: ");
                for (count = 0; count < saved_output.count; count ++) {
-                       if (isprint((unsigned char)saved_output.data[count]))
-                           fprintf(stderr, "%c", saved_output.data[count]);
+                       unsigned char b = saved_output.data[count];
+                       if (isprint(b))
+                               fprintf(stderr, "%c", b);
+                       else
+                               fprintf(stderr, "\\x%02x", b);
                }
                fprintf(stderr, "\n");
        }



Home | Main Index | Thread Index | Old Index