Skip to content

Commit

Permalink
fix comparison of checksum sizes
Browse files Browse the repository at this point in the history
print the checksum size on error

Signed-off-by: Robert Marklund <[email protected]>
  • Loading branch information
trollkarlen committed Jan 8, 2025
1 parent 6bf440e commit caf0f61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Fileinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Fileinfo::fillwithbytes(enum readtobuffermode filltype,
// store the result of the checksum calculation in somebytes
int digestlength = chk.getDigestLength();
if (digestlength <= 0 ||
digestlength >= static_cast<int>(m_somebytes.size())) {
std::cerr << "wrong answer from getDigestLength! FIXME" << std::endl;
digestlength > static_cast<int>(m_somebytes.size())) {
std::cerr << "wrong answer from getDigestLength(" << digestlength << ")! FIXME" << std::endl;
}
if (chk.printToBuffer(m_somebytes.data(), m_somebytes.size())) {
std::cerr << "failed writing digest to buffer!!" << std::endl;
Expand Down

0 comments on commit caf0f61

Please sign in to comment.