about summary refs log tree commit diff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index e08908cd78ec..b873baacb932 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -532,10 +532,10 @@ static void opGC(Strings opFlags, Strings opArgs)
         else if (*i == "--print-dead") options.action = GCOptions::gcReturnDead;
         else if (*i == "--delete") options.action = GCOptions::gcDeleteDead;
         else if (*i == "--max-freed") {
-            options.maxFreed = getIntArg(*i, i, opFlags.end());
-            if (options.maxFreed == 0) options.maxFreed = 1;
+            long long maxFreed = getIntArg<long long>(*i, i, opFlags.end());
+            options.maxFreed = maxFreed >= 1 ? maxFreed : 1;
         }
-        else if (*i == "--max-links") options.maxLinks = getIntArg(*i, i, opFlags.end());
+        else if (*i == "--max-links") options.maxLinks = getIntArg<unsigned int>(*i, i, opFlags.end());
         else throw UsageError(format("bad sub-operation `%1%' in GC") % *i);
 
     if (!opArgs.empty()) throw UsageError("no arguments expected");