Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMP: ReadVtkStructuredPoints-Fix compiler warning about over flow in memset #932

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ int32 skipVolume(std::istream& in, bool binary, usize numElements)
{
const usize BUFFER_SIZE = 16384;
usize foundItems = 0;
std::vector<char> buffer(BUFFER_SIZE, 0);
std::vector<char> buffer(BUFFER_SIZE + 1, 0);
while(foundItems < numElements)
{
memset(buffer.data(), 0, BUFFER_SIZE + 1);
err = CsvParser::ReadLine(in, buffer.data(), buffer.size());
foundItems += count_tokens(buffer.data(), ' ', false, BUFFER_SIZE);
memset(buffer.data(), 0, BUFFER_SIZE + 1); // Splat Zeros across everything
imikejackson marked this conversation as resolved.
Show resolved Hide resolved
err = CsvParser::ReadLine(in, buffer.data(), BUFFER_SIZE); // Read BUFFER_SIZE worth of data.
foundItems += count_tokens(buffer.data(), ' ', false, BUFFER_SIZE + 1);
}
}
return err;
Expand All @@ -221,10 +221,9 @@ int32 vtkReadBinaryData(std::istream& in, DataArray<T>& data)
DataStoreType& dataStore = data.getDataStoreRef();

usize numBytesToRead = static_cast<usize>(numTuples) * static_cast<usize>(numComp) * sizeof(T);
usize numRead = 0;
// Cast our pointer to a pointer that std::istream will take

numRead = 0;
usize numRead = 0;
// Now start reading the data in chunks if needed.
usize chunkSize = DEFAULT_BLOCKSIZE;

Expand Down
Loading