Commits

Ville Suoranta authored 2f8b67389ff Merge
Merge pull request #852 in CASA/casa from CAS-12231 to master

* commit 'cc0e7be19ad6461ac393acc9e2e3a7c6cdf78e62': CAS-12231, fixes bug in TableStreamReader introduced in CAS-11724
No tags

code/alma/ASDM/TableStreamReader.h

Modified
152 152 asdm::Entity containerEntity = Entity::fromBin((EndianIStream &)eifs);
153 153
154 154 // Let's read numRows but ignore it and rely on the value specified in the ASDM.xml file.
155 155 ((EndianIStream &)eifs).readInt();
156 156
157 157 // Memorize the starting point of rows.
158 158 whereRowsStart = tableFile.tellg();
159 159
160 160 // find where the rows end, seek to near the end
161 161 tableFile.seekg(fileSizeInBytes-100);
162 - std::string lastPart = accumulateUntilBoundary(boundary_1, 5);
162 + // the accumulateUntilBoundary looks at "lines", but it may be starting
163 + // from inside the binary part where null values might be found
164 + // At most, there might be 100 bytes of null, or 100 lines. So limit
165 + // the search to 100 lines before giving up.
166 + std::string lastPart = accumulateUntilBoundary(boundary_1, 100);
163 167
164 168 // the full size of the boundary and anything after it
165 169 endBoundarySizeInBytes = 100 - lastPart.size();
166 170
167 171 // reset back to start of rows
168 172 tableFile.seekg(whereRowsStart);
169 173
170 174 // Update the state
171 175 currentState = S_OPENED;
172 176 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut