Prechádzať zdrojové kódy

Fix clang-tidy: function 'rewind' has no error detection; 'fseek' should be used instead [bugprone-unsafe-functions,-warnings-as-errors] (#5265)

Boaz Brickner 1 rok pred
rodič
commit
817dacfc77
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      testing/file_test/run_test.cpp

+ 1 - 1
testing/file_test/run_test.cpp

@@ -122,7 +122,7 @@ auto RunTestFile(const FileTestBase& test_base, bool dump_output,
       input_stream = tmpfile();
       fwrite(split->content.c_str(), sizeof(char), split->content.size(),
              input_stream);
-      rewind(input_stream);
+      CARBON_CHECK(!fseek(input_stream, 0, SEEK_SET));
     } else if (!fs->addFile(split->filename, /*ModificationTime=*/0,
                             llvm::MemoryBuffer::getMemBuffer(
                                 split->content, split->filename,