Mail Archives: djgpp-workers/1999/02/07/04:34:36
> there is some problem with 'putc' in djgpp v2.01. it should only return
> EOF when error occured, but it also returns EOF (= -1) when first
> character sent to created file is 0xff
This is because the character is not casted to unsigned char in the
call to _flsbuf. To be corrected in the next release.
If you have library sources, then apply the following patch to the
file include/libc/file.h, recompile putc.c (and fputc.c), put them
into libc.a, and the problem should go away.
*** include/libc/file.h~0 Sun Sep 7 21:08:12 1997
--- include/libc/file.h Sat Feb 6 11:10:46 1999
***************
*** 49,55 ****
p->_cnt--;
return((unsigned char)(*(p->_ptr++)=(unsigned char)x));
}
! return(_flsbuf(x,p));
}
static __inline__ int __is_text_file(FILE *const p)
--- 49,55 ----
p->_cnt--;
return((unsigned char)(*(p->_ptr++)=(unsigned char)x));
}
! return(_flsbuf((unsigned char)x,p));
}
static __inline__ int __is_text_file(FILE *const p)
- Raw text -