diff options
author | Mattias Andrée <maandree@kth.se> | 2016-12-01 14:39:07 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-12-01 14:39:07 +0100 |
commit | 14e8429616a782002df61e15eb003b30dbd9df29 (patch) | |
tree | bd684b252847cf89f060cf41c83f92f2d56895f6 | |
parent | Fix bugs (diff) | |
download | cg-tools-14e8429616a782002df61e15eb003b30dbd9df29.tar.gz cg-tools-14e8429616a782002df61e15eb003b30dbd9df29.tar.bz2 cg-tools-14e8429616a782002df61e15eb003b30dbd9df29.tar.xz |
Check that the value of -p is proper
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | src/cg-base.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cg-base.c b/src/cg-base.c index a8c7f71..d9da32a 100644 --- a/src/cg-base.c +++ b/src/cg-base.c @@ -653,7 +653,13 @@ int main(int argc, char* argv[]) return 0; } else if (prio != NULL) - priority = (int64_t)atoll(prio); + { + char *end; + errno = 0; + priority = (int64_t)strtoll(prio, &end, 10); + if (errno || *end) + usage(); + } if (!nulstrcmp(rule, "??")) { |