Skip to content

Commit

Permalink
Fixed hexstream conversions on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
acpaquette committed Feb 19, 2025
1 parent 6e8acc4 commit ecd8d56
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions isis/src/base/objs/Blob/Blob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,16 +654,14 @@ namespace Isis {
/**
* Writes blob data to a stream
*
* @param stream Output steam blob data will be written to
* @param stream Output stream blob data will be written to
*
* @throws IException::Io - Error writing data to stream
*/
void Blob::WriteData(std::stringstream &stream) {
stream << std::hex;
int copy;
stream << std::hex << std::setfill('0');
for (int i = 0; i < p_nbytes; ++i) {
memcpy(&copy, &p_buffer[i], 1);
stream << std::setw(2) << std::setfill('0') << copy;
stream << std::setw(2) << static_cast<unsigned>(p_buffer[i]);
}

if (!stream.good()) {
Expand All @@ -687,7 +685,7 @@ namespace Isis {
p_buffer[p_nbytes] = '\0';

// Loop through the hex string and bytes, hex is two characters at a time
for (size_t i=0,j=0; i < p_nbytes; i++,j+=2) {
for (size_t i=0,j=0; i < p_nbytes; i++,j+=2) {
string byteString = hexdata.substr(j, 2);

int byteValue = static_cast<int>(
Expand Down

0 comments on commit ecd8d56

Please sign in to comment.