Restore asserts and error handling

A couple of them got improved out of existence.
This commit is contained in:
John Hood
2017-08-13 00:27:23 -04:00
parent 790b479f8a
commit b11d524bb7
6 changed files with 27 additions and 22 deletions
+3 -1
View File
@@ -140,7 +140,9 @@ void Emulator::print( const Parser::Print *act )
}
break;
case -1: /* unprintable character */
default: /* bogus width, ignore */
break;
default:
assert( !"unexpected character width from wcwidth()" );
break;
}
}
+5 -2
View File
@@ -46,6 +46,9 @@ string UserInput::input( const Parser::UserByte *act,
/* We need to look ahead one byte in the SS3 state to see if
the next byte will be A, B, C, or D (cursor control keys). */
/* This doesn't handle the 8-bit SS3 C1 control, which would be
two octets in UTF-8. Fortunately nobody seems to send this. */
switch ( state ) {
case Ground:
if ( act->c == 0x1b ) { /* ESC */
@@ -74,8 +77,8 @@ string UserInput::input( const Parser::UserByte *act,
}
default:
/* This doesn't handle the 8-bit SS3 C1 control, which would be
two octets in UTF-8. Fortunately nobody seems to send this. */
assert( !"unexpected state" );
state = Ground;
return string();
}
}