From: Kamalesh Babulal Date: Thu, 29 Sep 2022 10:19:46 +0000 (+0530) Subject: tools/cgdelete: add check for the cmdline arguments X-Git-Tag: v3.1.0~304 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de86f6862d439f4c680f07f02a1496661bb1f7a7;p=thirdparty%2Flibcgroup.git tools/cgdelete: add check for the cmdline arguments Like other tools, throw an error and exit if the minimum required arguments are not passed. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/src/tools/cgdelete.c b/src/tools/cgdelete.c index 7eaab2cb..28ddca35 100644 --- a/src/tools/cgdelete.c +++ b/src/tools/cgdelete.c @@ -123,6 +123,11 @@ int main(int argc, char *argv[]) int i, j, c; int skip; + if (argc < 2) { + usage(1, argv[0]); + exit (1); + } + /* initialize libcg */ ret = cgroup_init(); if (ret) {