瀏覽代碼

Fixed win32 seek/tell issue.

Brucey 3 年之前
父節點
當前提交
73bd664c9f
共有 1 個文件被更改,包括 2 次插入8 次删除
  1. 2 8
      stdc.mod/stdc.c

+ 2 - 8
stdc.mod/stdc.c

@@ -323,17 +323,11 @@ 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;
+	return (_fseeki64(stream, offset, origin) == 0) ? 0 : 1;
 }
 
 BBLONG ftell_( FILE* stream ) {
-	// flush stream when using _fileno
-	fflush(stream);
-	int f = _fileno(stream);
-	return _telli64(f);
+	return _felli64(stream);
 }
 
 int ftruncate_(FILE* stream, BBLONG size) {