Fix asserts with side-effects (per Keegan McAllister)

This commit is contained in:
Keith Winstein
2012-03-08 10:50:19 -05:00
parent 4a29ab9d70
commit df5d163f9c
15 changed files with 80 additions and 35 deletions
+2 -1
View File
@@ -21,6 +21,7 @@
#include <poll.h>
#include "user.h"
#include "fatal_assert.h"
#include "networktransport.cc"
using namespace Network;
@@ -117,7 +118,7 @@ int main( int argc, char *argv[] )
if ( fds[ 0 ].revents & POLLIN ) {
char x;
assert( read( STDIN_FILENO, &x, 1 ) == 1 );
fatal_assert( read( STDIN_FILENO, &x, 1 ) == 1 );
n->get_current_state().push_back( Parser::UserByte( x ) );
}