aboutsummaryrefslogtreecommitdiff
path: root/src/nix/verify.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-10 15:03:01 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-10 15:03:01 +0200
commit95cf23ee7c5b0fd69b21811989a5668f4261fd51 (patch)
treeef7ccdd754141565941ba4e168a4cd4e15c6983e /src/nix/verify.cc
parentc3aaf3b8da1a925c569389f13a861816a781a3c8 (diff)
nix verify: Fix uninitialized variable
Diffstat (limited to 'src/nix/verify.cc')
-rw-r--r--src/nix/verify.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nix/verify.cc b/src/nix/verify.cc
index 2e0d5cffe..74d9673b6 100644
--- a/src/nix/verify.cc
+++ b/src/nix/verify.cc
@@ -13,7 +13,7 @@ struct CmdVerify : StorePathsCommand
bool noContents = false;
bool noTrust = false;
Strings substituterUris;
- size_t sigsNeeded;
+ size_t sigsNeeded = 0;
CmdVerify()
{
@@ -113,7 +113,7 @@ struct CmdVerify : StorePathsCommand
else {
StringSet sigsSeen;
- size_t actualSigsNeeded = sigsNeeded ? sigsNeeded : 1;
+ size_t actualSigsNeeded = std::max(sigsNeeded, (size_t) 1);
size_t validSigs = 0;
auto doSigs = [&](StringSet sigs) {