Skip to content

Commit 6ea339c

Browse files
Update src/nix-env/nix-env.cc
Co-authored-by: Eelco Dolstra <[email protected]>
1 parent 3716ded commit 6ea339c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/nix-env/nix-env.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,9 @@ static void opInstall(Globals & globals, Strings opFlags, Strings opArgs)
588588
else if (arg == "--priority") {
589589
if (i == opFlags.end())
590590
throw UsageError("'%1%' requires an argument", arg);
591-
priority = std::stoi(*i++);
591+
priority = string2Int<int>(*i++);
592+
if (!priority)
593+
throw UsageError("'--priority' requires an integer argument");
592594
}
593595
else throw UsageError("unknown flag '%1%'", arg);
594596
}

0 commit comments

Comments
 (0)