mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
Fix hash error message
Wrong number of arguments was causing a format assertion.
This commit is contained in:
parent
c242706319
commit
c6d06ce486
1 changed files with 2 additions and 1 deletions
|
|
@ -135,7 +135,8 @@ static Hash parseLowLevel(std::string_view rest, HashAlgorithm algo, DecodeNameP
|
||||||
e.addTrace({}, "While decoding hash '%s'", rest);
|
e.addTrace({}, "While decoding hash '%s'", rest);
|
||||||
}
|
}
|
||||||
if (d.size() != res.hashSize)
|
if (d.size() != res.hashSize)
|
||||||
throw BadHash("invalid %s hash '%s' %d %d", pair.encodingName, rest);
|
throw BadHash(
|
||||||
|
"invalid %s hash '%s', length %d != expected length %d", pair.encodingName, rest, d.size(), res.hashSize);
|
||||||
assert(res.hashSize);
|
assert(res.hashSize);
|
||||||
memcpy(res.hash, d.data(), res.hashSize);
|
memcpy(res.hash, d.data(), res.hashSize);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue