From 8fd0b0f5a6da7c5660df6e74c2d4124f6e1afd65 Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Wed, 28 Apr 2021 20:36:03 +0100 Subject: [PATCH] Uthernet 2: use isprint(); Signed-off-by: Andrea Odetti --- source/linux/network/uthernet2.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/source/linux/network/uthernet2.cpp b/source/linux/network/uthernet2.cpp index a07396bf..1d2b8a82 100644 --- a/source/linux/network/uthernet2.cpp +++ b/source/linux/network/uthernet2.cpp @@ -657,20 +657,7 @@ namespace #ifdef U2_LOG_VERBOSE const char * mode = write ? "WRITE " : "READ "; - - char c; - switch (res) - { - case 'A'...'Z': - case 'a'...'z': - case '0'...'9': - c = res; - break; - default: - c = '.'; - break; - } - + const char c = std::isprint(res) ? res : '.'; LogFileOutput("U2: %04x: %s %04x %02x = %02x, %c\n", programcounter, mode, address, value, res, c); #endif