Commit 5010ad71 authored by Purves, Murray's avatar Purves, Murray
Browse files

Fixing format specifier in index header write;

parent 9ed9e892
Pipeline #16774 failed with stages
in 8 minutes and 40 seconds
......@@ -159,6 +159,7 @@ bool ARLDataStream::read_index_header(const ARLRecordHeader& rheader,
bool result = false;
// Read main part of index header
radix_line(" Reading main part of index header...");
std::string headerString =
p->stream->readString(ARLDataStream::PImpl::indexHeaderLength);
expand(headerString, rheader, iheader);
......@@ -168,6 +169,8 @@ bool ARLDataStream::read_index_header(const ARLRecordHeader& rheader,
(iheader.nx * iheader.ny) + ARLDataStream::PImpl::recordHeaderLength;
// Read variable description part of index header
radix_line(" Reading variable part of index header... " << iheader.nz
<< " levels");
for (size_t level = 0; level < iheader.nz; ++level)
{
// Read levels information
......@@ -179,6 +182,8 @@ bool ARLDataStream::read_index_header(const ARLRecordHeader& rheader,
// Read names and checksums
iheader.varNames.push_back(std::vector<std::string>());
iheader.checkSums.push_back(std::vector<int>());
radix_line(" Level " << level << "... " << iheader.nVarsAtLevels[level]
<< " vars");
for (size_t var = 0; var < iheader.nVarsAtLevels[level]; ++var)
{
std::string nameString = p->stream->readString(4);
......@@ -223,7 +228,7 @@ bool ARLDataStream::write_index_header(const ARLRecordHeader& rheader,
// Write the variable description part of the header
for (size_t level = 0; level < iheader.nz; ++level)
{
pos += sprintf(indexHeaderVars + pos, "%6.2f", iheader.levels[level]);
pos += sprintf(indexHeaderVars + pos, "%6.1f", iheader.levels[level]);
pos += sprintf(indexHeaderVars + pos, "%2d", iheader.nVarsAtLevels[level]);
for (size_t var = 0; var < iheader.nVarsAtLevels[level]; ++var)
{
......@@ -258,7 +263,8 @@ bool ARLDataStream::write_index_header(const ARLRecordHeader& rheader,
p->stream->writeString("", bytesToSkip);
radix_line(" header as string:\n " << indexHeaderVars);
radix_line(" header as string:\n " << indexHeaderMain
<< indexHeaderVars);
result = true;
return result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment