소스 검색

Merge pull request #11027 from hpvb/fix-11022

Fix EOF in wav file importer
Juan Linietsky 8 년 전
부모
커밋
b19b7aebf7
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      drivers/unix/file_access_unix.cpp

+ 2 - 4
drivers/unix/file_access_unix.cpp

@@ -164,7 +164,6 @@ void FileAccessUnix::seek_end(int64_t p_position) {
 
 
 	ERR_FAIL_COND(!f);
 	ERR_FAIL_COND(!f);
 
 
-	last_error = OK;
 	if (fseek(f, p_position, SEEK_END))
 	if (fseek(f, p_position, SEEK_END))
 		check_errors();
 		check_errors();
 }
 }
@@ -173,7 +172,6 @@ size_t FileAccessUnix::get_pos() const {
 
 
 	ERR_FAIL_COND_V(!f, 0);
 	ERR_FAIL_COND_V(!f, 0);
 
 
-	last_error = OK;
 	int pos = ftell(f);
 	int pos = ftell(f);
 	if (pos < 0) {
 	if (pos < 0) {
 		check_errors();
 		check_errors();
@@ -207,8 +205,8 @@ uint8_t FileAccessUnix::get_8() const {
 	uint8_t b;
 	uint8_t b;
 	if (fread(&b, 1, 1, f) == 0) {
 	if (fread(&b, 1, 1, f) == 0) {
 		check_errors();
 		check_errors();
-	};
-
+		b = '\0';
+	}
 	return b;
 	return b;
 }
 }