Explorar o código

Merge pull request #1 from GWRon/fix_fseek_ftell

Fix fseek_ and ftell_ on Win32
Brucey %!s(int64=10) %!d(string=hai) anos
pai
achega
3a0b4bfefa
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      stdc.mod/stdc.c

+ 4 - 0
stdc.mod/stdc.c

@@ -190,11 +190,15 @@ int system_( BBString *cmd ){
 }
 
 int fseek_( FILE* stream, BBLONG offset, int origin ) {
+	// flush stream when using _fileno
+	fflush(stream);
 	int f = _fileno(stream);
 	return (_lseeki64(f, offset, origin) >= 0) ? 0 : 1;
 }
 
 BBLONG ftell_( FILE* stream ) {
+	// flush stream when using _fileno
+	fflush(stream);
 	int f = _fileno(stream);
 	return _telli64(f);
 }