Mail Archives: djgpp/1994/08/11/12:22:26
Hi,
I have a problem with fseek() in the new 1.12 release.
If I replace libc.a with the old library ( libc.a in 1.11m5 )
everything is ok.
test.c:
#include <stdio.h>
void main()
{
FILE *fp;
int c;
fp = fopen("test.dat","rb");
if (fp)
{
c = fgetc(fp);
printf("Pos %ld\n", ftell(fp));
fseek(fp, 1L, SEEK_CUR);
c = fgetc(fp);
printf("Pos %ld\n", ftell(fp));
}
}
The output should be:
Pos 1
Pos 3
But the output is:
Pos 1
Pos x x is the length of test.dat + 1L
The output is the same when I replace SEEK_CUR with SEEK_END.
Marios Siormanolakis
sior AT ira DOT uka DOT de
- Raw text -