Skip to content

Commit

Permalink
bp: workaround for char overflow in bp vers
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Dec 29, 2023
1 parent b60f037 commit 648843d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source/adios2/engine/bp5/BP5Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,8 @@ void BP5Writer::MakeHeader(std::vector<char> &buffer, size_t &position, const st
}

const std::string majorVersion(std::to_string(ADIOS2_VERSION_MAJOR));
const std::string minorVersion(std::to_string(ADIOS2_VERSION_MINOR));
const char minorVersionChar = '0' + ADIOS2_VERSION_MINOR;
const std::string minorVersion(1, minorVersionChar);
const std::string patchVersion(std::to_string(ADIOS2_VERSION_PATCH));

// byte 0-31: Readable tag
Expand Down
3 changes: 2 additions & 1 deletion source/adios2/toolkit/format/bp/BPSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ void BPSerializer::PutMinifooter(const uint64_t pgIndexStart, const uint64_t var
};

const std::string majorVersion(std::to_string(ADIOS2_VERSION_MAJOR));
const std::string minorVersion(std::to_string(ADIOS2_VERSION_MINOR));
const char minorVersionChar = '0' + ADIOS2_VERSION_MINOR;
const std::string minorVersion(1, minorVersionChar);
const std::string patchVersion(std::to_string(ADIOS2_VERSION_PATCH));

const std::string versionLongTag("ADIOS-BP v" + majorVersion + "." + minorVersion + "." +
Expand Down
3 changes: 2 additions & 1 deletion source/adios2/toolkit/format/bp/bp4/BP4Serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ void BP4Serializer::MakeHeader(BufferSTL &b, const std::string fileType, const b
}

const std::string majorVersion(std::to_string(ADIOS2_VERSION_MAJOR));
const std::string minorVersion(std::to_string(ADIOS2_VERSION_MINOR));
const char minorVersionChar = '0' + ADIOS2_VERSION_MINOR;
const std::string minorVersion(1, minorVersionChar);
const std::string patchVersion(std::to_string(ADIOS2_VERSION_PATCH));

// byte 0-31: Readable tag
Expand Down

0 comments on commit 648843d

Please sign in to comment.