diff options
| author | Michael Biebl <biebl@debian.org> | 2013-02-03 14:49:22 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2013-02-03 14:49:22 +0100 |
| commit | 9c202e3e860b3be9e1f8882630b69affbb130102 (patch) | |
| tree | 8202bf39f2129486971fa7d5ae0dee61a561aa53 /cli/src/utils.c | |
| parent | 36cb2f364a821e1be50b23e03a18891ec55adb06 (diff) | |
Imported Upstream version 0.9.7.995 upstream/0.9.7.995
Diffstat (limited to 'cli/src/utils.c')
| -rw-r--r-- | cli/src/utils.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/src/utils.c b/cli/src/utils.c index 4054fe13..ab0a5dba 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -45,13 +45,15 @@ matches (const char *cmd, const char *pattern) int next_arg (int *argc, char ***argv) { - if (*argc <= 1) { - return -1; - } - else { + int arg_num = *argc; + + if (arg_num > 0) { (*argc)--; (*argv)++; } + if (arg_num <= 1) + return -1; + return 0; } |