Re: ungetc and fseek/ftell cause segmentation bug

2011-01-18 Thread Waclaw Kusnierczyk
There is indeed something wrong here. I have rewritten your code to the essentials, to be able to check (a) whether the length of the file matters, (b) ensure none of the fseek, ftell, fgetc and ungetc functions reports an error before fclose crashes. The code is attached. The command I use

ungetc and fseek/ftell cause segmentation bug

2011-01-18 Thread Stefan Sablatnög
Hi everybody, I encounter a bug with ungetc on many different glibc system, though all are ubuntu, at least debain I thought this place would be right. My problem is a segmentation fault on fclose, that happens when I run the following short test program. Assume a file named abc exists and it c