Skip to content

Commit c6d06ce

Browse files
committed
Fix hash error message
Wrong number of arguments was causing a format assertion.
1 parent c242706 commit c6d06ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libutil/hash.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ static Hash parseLowLevel(std::string_view rest, HashAlgorithm algo, DecodeNameP
135135
e.addTrace({}, "While decoding hash '%s'", rest);
136136
}
137137
if (d.size() != res.hashSize)
138-
throw BadHash("invalid %s hash '%s' %d %d", pair.encodingName, rest);
138+
throw BadHash(
139+
"invalid %s hash '%s', length %d != expected length %d", pair.encodingName, rest, d.size(), res.hashSize);
139140
assert(res.hashSize);
140141
memcpy(res.hash, d.data(), res.hashSize);
141142

0 commit comments

Comments
 (0)