Test for EOF returned by stdio routines have to use the full int width.
This commit is contained in:
parent
52a627589a
commit
f7027ba7e4
1 changed files with 4 additions and 2 deletions
|
@ -59,6 +59,7 @@ _zone()
|
||||||
_in(buf)
|
_in(buf)
|
||||||
char *buf;
|
char *buf;
|
||||||
{
|
{
|
||||||
|
register int holder ;
|
||||||
char *c;
|
char *c;
|
||||||
int pos;
|
int pos;
|
||||||
if( _chann == -1)
|
if( _chann == -1)
|
||||||
|
@ -69,8 +70,9 @@ char *buf;
|
||||||
stty(0,_ttydef);
|
stty(0,_ttydef);
|
||||||
}else pos= _fdtable[_chann].pos;
|
}else pos= _fdtable[_chann].pos;
|
||||||
c= buf;
|
c= buf;
|
||||||
while( (*c = fgetc(_chanrd)) != EOF && *c != '\n'){
|
while( (holder = fgetc(_chanrd)) != EOF && holder != '\n'){
|
||||||
if( _chann == -1) putchar(*c);
|
*c= holder ;
|
||||||
|
if( _chann == -1) putchar(holder);
|
||||||
c++; pos++;
|
c++; pos++;
|
||||||
}
|
}
|
||||||
*c= 0;
|
*c= 0;
|
||||||
|
|
Loading…
Reference in a new issue