summaryrefslogtreecommitdiffstats
path: root/src/core/debug.c
diff options
context:
space:
mode:
authorMichael Brown2014-01-03 02:21:52 +0100
committerMichael Brown2014-01-06 01:46:20 +0100
commita4e8ef72ab523568fa5c1cd356a3c14f8403d2e4 (patch)
tree9d4566eddb037a0edb81a362bd303414546ac0c5 /src/core/debug.c
parent[build] Build ROMs used by qemu and VMware as part of "make all" (diff)
downloadipxe-a4e8ef72ab523568fa5c1cd356a3c14f8403d2e4.tar.gz
ipxe-a4e8ef72ab523568fa5c1cd356a3c14f8403d2e4.tar.xz
ipxe-a4e8ef72ab523568fa5c1cd356a3c14f8403d2e4.zip
[libc] Add isprint()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/debug.c')
-rw-r--r--src/core/debug.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/debug.c b/src/core/debug.c
index 627d5d9a..2161f973 100644
--- a/src/core/debug.c
+++ b/src/core/debug.c
@@ -22,6 +22,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
+#include <ctype.h>
#include <ipxe/console.h>
/**
@@ -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" );
}