Skip to content

Commit

Permalink
Fix stream writing to correct position
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Feb 16, 2025
1 parent f47fc15 commit a9b5da8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/libpcsc-cpp/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ std::ostream& operator<<(std::ostream& os, const pcsc_cpp::byte_vector& data)

std::string operator+(std::string lhs, const byte_vector& rhs)
{
auto pos = lhs.size();
lhs.reserve(lhs.size() + rhs.size() * 2);
std::ostringstream hexStringBuilder(std::move(lhs));
hexStringBuilder.seekp(std::streamoff(pos));
hexStringBuilder << rhs;
return hexStringBuilder.str();
}
Expand Down

0 comments on commit a9b5da8

Please # to comment.