diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-05-17 20:58:47 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-05-17 20:58:47 -0400 |
commit | 80f70292b2e74533ac56a20433ec0296a6e4b537 (patch) | |
tree | 29613b01ebdaa0d6df5c3a263d60305de317e4bd | |
parent | b8bcc46f9d54288f8df6ad41a7b2abca7b65c780 (diff) |
trace-cmd/split: Do not allow zero or negative units
On trace-cmd split, do not allow zero or negative units.
Reported-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-split.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/trace-split.c b/trace-split.c index 71ba8c1..c569524 100644 --- a/trace-split.c +++ b/trace-split.c | |||
@@ -438,6 +438,8 @@ void trace_split (int argc, char **argv) | |||
438 | if (split_type != SPLIT_NONE) | 438 | if (split_type != SPLIT_NONE) |
439 | die("Only one type of split is allowed"); | 439 | die("Only one type of split is allowed"); |
440 | count = atoi(optarg); | 440 | count = atoi(optarg); |
441 | if (count <= 0) | ||
442 | die("Units must be greater than 0"); | ||
441 | split_type = type; | 443 | split_type = type; |
442 | break; | 444 | break; |
443 | case 'r': | 445 | case 'r': |