소스 검색

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) {