[libc] Add isprint()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2014-01-03 02:21:52 +01:00
parent bf15737cf0
commit a4e8ef72ab
2 changed files with 3 additions and 3 deletions

View File

@@ -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" );
}