Skip to content

Commit

Permalink
Reset file position back to begin before read
Browse files Browse the repository at this point in the history
  • Loading branch information
rascani committed Sep 8, 2023
1 parent 2765581 commit 80c9a38
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions codegen/preprocessor/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ std::unique_ptr<char[]> ReadModelFile(const char* model_file_name) {

model_file.seekg(0, std::ios::end);
size_t num_bytes = model_file.tellg();
model_file.seekg(0,std::ios::beg);
std::unique_ptr<char[]> model_data(new char[num_bytes]);
model_file.read(model_data.get(), num_bytes);

Expand Down

0 comments on commit 80c9a38

Please sign in to comment.