Fix wchar_t format string types
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
@@ -187,9 +187,9 @@ int vt_parser( int fd, Parser::UTF8Parser *parser )
|
||||
|
||||
if ( act->char_present ) {
|
||||
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(), (unsigned int)act->ch, act->ch );
|
||||
} else {
|
||||
printf( "%s(0x%02x) ", act->name().c_str(), act->ch );
|
||||
printf( "%s(0x%02x) ", act->name().c_str(), (unsigned int)act->ch );
|
||||
}
|
||||
} else {
|
||||
printf( "[%s] ", act->name().c_str() );
|
||||
|
||||
@@ -28,7 +28,10 @@ std::string Action::str( void )
|
||||
{
|
||||
char thechar[ 10 ] = { 0 };
|
||||
if ( char_present ) {
|
||||
snprintf( thechar, 10, iswprint( ch ) ? "(%lc)" : "(0x%x)", ch );
|
||||
if ( iswprint( ch ) )
|
||||
snprintf( thechar, 10, "(%lc)", ch );
|
||||
else
|
||||
snprintf( thechar, 10, "(0x%x)", (unsigned int)ch );
|
||||
}
|
||||
|
||||
return name() + std::string( thechar );
|
||||
|
||||
@@ -246,7 +246,7 @@ void Display::put_cell( bool initialized, FrameState &frame, const Framebuffer &
|
||||
|
||||
/* cells that begin with combining character get combiner attached to no-break space */
|
||||
if ( cell->fallback ) {
|
||||
snprintf( tmp, 64, "%lc", 0xA0 );
|
||||
snprintf( tmp, 64, "%lc", L'\xA0' );
|
||||
frame.append( tmp );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user