Test for EOF returned by stdio routines have to use the full int width.

This commit is contained in:
keie 1985-01-21 23:52:19 +00:00
parent 52a627589a
commit f7027ba7e4

View file

@ -59,6 +59,7 @@ _zone()
_in(buf)
char *buf;
{
register int holder ;
char *c;
int pos;
if( _chann == -1)
@ -69,8 +70,9 @@ char *buf;
stty(0,_ttydef);
}else pos= _fdtable[_chann].pos;
c= buf;
while( (*c = fgetc(_chanrd)) != EOF && *c != '\n'){
if( _chann == -1) putchar(*c);
while( (holder = fgetc(_chanrd)) != EOF && holder != '\n'){
*c= holder ;
if( _chann == -1) putchar(holder);
c++; pos++;
}
*c= 0;