Re: An MSVCRT_fgetc bug

2006-09-25 Thread Chris Robinson
On Monday 25 September 2006 01:04, Tobias Ringström wrote: > There's a bug in MSVCRT_fgetc in 0.9.21 (likely introduced in 0.9.19) in > that it sometimes sign extends the byte read from the file. Looks like 'char *i;' should be 'unsigned char *i;'.

An MSVCRT_fgetc bug

2006-09-25 Thread Tobias Ringström
There's a bug in MSVCRT_fgetc in 0.9.21 (likely introduced in 0.9.19) in that it sometimes sign extends the byte read from the file. The following program illustrates the problem: #include int main() { FILE *f = fopen("tmp.bin", "w+"); fputc(0xe0, f); fputc(0