diff options
author | Mattias Andrée <maandree@kth.se> | 2016-12-01 13:41:15 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-12-01 13:41:15 +0100 |
commit | 7489bc210520c027e95f0ee8c8df8d0805f50f67 (patch) | |
tree | 01486d2494e5b91d4dbaa75586b6d6688a6e837a /src/cg-limits.c | |
parent | Add cg-tools.7 (diff) | |
download | cg-tools-7489bc210520c027e95f0ee8c8df8d0805f50f67.tar.gz cg-tools-7489bc210520c027e95f0ee8c8df8d0805f50f67.tar.bz2 cg-tools-7489bc210520c027e95f0ee8c8df8d0805f50f67.tar.xz |
Fix arg parsing
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | src/cg-limits.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/cg-limits.c b/src/cg-limits.c index 5df54e3..78f0b6c 100644 --- a/src/cg-limits.c +++ b/src/cg-limits.c @@ -481,25 +481,15 @@ static int parse_contrast_file(const char* restrict pathname) * This function is called after the last * call to `handle_opt` * - * @param argc The number of unparsed arguments - * @param argv `NULL` terminated list of unparsed arguments - * @param method The argument associated with the "-M" option - * @param site The argument associated with the "-S" option - * @param crtcs_ The arguments associated with the "-c" options, `NULL`-terminated - * @param prio The argument associated with the "-p" option - * @param rule The argument associated with the "-R" option + * @param argc The number of unparsed arguments + * @param argv `NULL` terminated list of unparsed arguments + * @param prio The argument associated with the "-p" option * @return Zero on success, -1 on error */ -int handle_args(int argc, char* argv[], char* method, char* site, - char** crtcs_, char* prio, char* rule) +int handle_args(int argc, char* argv[], char* prio) { int free_Bflag = 0, free_Cflag = 0, saved_errno; int q = xflag + dflag; - q += (method != NULL) && !strcmp(method, "?"); - q += (prio != NULL) && !strcmp(prio, "?"); - q += (rule != NULL) && (!strcmp(rule, "?") || !strcmp(rule, "??")); - for (; *crtcs_; crtcs_++) - q += !strcmp(*crtcs_, "?"); if ((q > 1) || (xflag && ((Bflag != NULL) || (Cflag != NULL) || (argc > 0) || (prio != NULL)))) usage(); if ((Bflag || Cflag) && argc) @@ -559,7 +549,6 @@ int handle_args(int argc, char* argv[], char* method, char* site, free(Cflag), Cflag = NULL; errno = saved_errno; return cleanup(-1); - (void) site; } |