diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1993-12-09 13:58:09 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1993-12-09 13:58:09 +0000 |
commit | e89ab843296311d34122769645394f04feb7f36c (patch) | |
tree | 34549c3f4b5b9769d67ed33b76c4f27b0ff6f422 /gen.c | |
parent | d865c176c6e5bf6768dbc4577595cdfe20d0baab (diff) |
Fixed bug in interactive reads where char is unsigned
Diffstat (limited to 'gen.c')
-rw-r--r-- | gen.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1255,10 +1255,13 @@ void make_tables() { printf( "\tif ( yy_current_buffer->is_interactive ) \\\n" ); + printf( "\t\t{ \\\n" ); + printf( "\t\tint c = getc( yyin ); \\\n" ); + printf( "\t\tresult = c == EOF ? 0 : 1; \\\n" ); + printf( "\t\tbuf[0] = (char) c; \\\n" ); + printf( "\t\t} \\\n" ); printf( -"\t\tresult = ((int) (buf[0] = getc( yyin ))) == EOF ? 0 : 1; \\\n" ); - printf( -"\telse if ( ((result = fread( (char *) buf, 1, max_size, yyin )) == 0)\\\n" ); + "\telse if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \\\n" ); printf( "\t\t && ferror( yyin ) ) \\\n" ); printf( "\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );\n" ); |