From a4e8ef72ab523568fa5c1cd356a3c14f8403d2e4 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 3 Jan 2014 02:21:52 +0100 Subject: [libc] Add isprint() Signed-off-by: Michael Brown --- src/core/debug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/debug.c b/src/core/debug.c index 627d5d9a1..2161f9731 100644 --- a/src/core/debug.c +++ b/src/core/debug.c @@ -22,6 +22,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include +#include #include /** @@ -96,9 +97,7 @@ static void dbg_hex_dump_da_row ( unsigned long dispaddr, const void *data, continue; } byte = bytes[i]; - if ( ( byte < 0x20 ) || ( byte >= 0x7f ) ) - byte = '.'; - dbg_printf ( "%c", byte ); + dbg_printf ( "%c", ( isprint ( byte ) ? byte : '.' ) ); } dbg_printf ( "\n" ); } -- cgit v1.2.3-55-g7522