Use iswprint() instead of isprint()

This commit is contained in:
Keith Winstein
2011-02-01 06:11:35 -05:00
parent fa31514de7
commit 7989265fa0
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ int vt_parser( int fd, Parser::UTF8Parser *parser )
assert( act ); assert( act );
if ( act->char_present ) { if ( act->char_present ) {
if ( isprint( act->ch ) ) { if ( iswprint( act->ch ) ) {
printf( "%s(0x%02x=%lc) ", act->name().c_str(), act->ch, act->ch ); printf( "%s(0x%02x=%lc) ", act->name().c_str(), act->ch, act->ch );
} else { } else {
printf( "%s(0x%02x) ", act->name().c_str(), act->ch ); printf( "%s(0x%02x) ", act->name().c_str(), act->ch );
+2 -2
View File
@@ -1,5 +1,5 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <wctype.h>
#include "parseraction.hpp" #include "parseraction.hpp"
#include "terminal.hpp" #include "terminal.hpp"
@@ -10,7 +10,7 @@ std::string Action::str( void )
{ {
char thechar[ 10 ] = { 0 }; char thechar[ 10 ] = { 0 };
if ( char_present ) { if ( char_present ) {
snprintf( thechar, 10, isprint( ch ) ? "(%lc)" : "(0x%x)", ch ); snprintf( thechar, 10, iswprint( ch ) ? "(%lc)" : "(0x%x)", ch );
} }
return name() + std::string( thechar ); return name() + std::string( thechar );