about summary refs log tree commit diff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2009-11-24T12·26+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2009-11-24T12·26+0000
commit9b8fda796b620a5476e8a50edcc29a3462667fc3 (patch)
treefa546a5b5a0b08c01a7bdc9ee50e69d7bfd87165 /src/nix-store/nix-store.cc
parent80220155523fb21c938d595e96597f6511aa7bd0 (diff)
* Templatise getIntArg / string2Int.
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");