Fix bug in state diagram

This commit is contained in:
Keith Winstein
2011-01-22 17:08:25 -05:00
parent b8d67c54f3
commit 65f7f3515c
2 changed files with 8 additions and 11 deletions
+7 -10
View File
@@ -67,18 +67,15 @@ std::string Emulator::input( char c, int actfd )
if ( (actfd > 0) && ( !act->handled ) ) {
char actsum[ 32 ];
wchar_t ch = L'\0';
if ( act->char_present ) {
if ( isprint( act->ch ) ) {
snprintf( actsum, 32, "%s(0x%02x=%lc) ",
act->name().c_str(), act->ch, act->ch );
} else {
snprintf( actsum, 32, "%s(0x%02x) ",
act->name().c_str(), act->ch );
}
} else {
snprintf( actsum, 32, "[%s] ",
act->name().c_str() );
ch = act->ch;
}
snprintf( actsum, 32, "%s[%s](%s){%lc} ",
act->name().c_str(),
dispatch_chars.c_str(),
params.c_str(),
ch );
swrite( actfd, actsum );
}