From ace390c5f03c2b87fff617e66ddec3ad75f6a93d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 27 Aug 2013 22:59:10 +0200 Subject: c fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/argparser.c | 4 ++-- src/test.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/argparser.c b/src/argparser.c index f274fd3..aa9650a 100644 --- a/src/argparser.c +++ b/src/argparser.c @@ -242,7 +242,7 @@ char* args_standard_abbreviations(char* argument, char** options, long count) for (i = 0; i < count; i++) { long match = 0; - char* opt = *options; + char* opt = *(options + i); while (*(argument + match) && (*(opt + match) == *(argument + match))) match++; if (*(argument + match) == 0) @@ -1461,7 +1461,7 @@ long args_parse(int argc, char** argv) } else { - if ((injection = args__abbreviations(arg)) == null) + if ((injection = args__abbreviations(arg_opt)) == null) { if (++args_unrecognised_count <= 5) fprintf(args_out, "%s: warning: unrecognised option %s\n", args_program, arg_opt); diff --git a/src/test.c b/src/test.c index 9d65b2e..59c5d9c 100644 --- a/src/test.c +++ b/src/test.c @@ -69,14 +69,14 @@ int main(int argc, char** argv) i = 0; arr = args_opts_get("--line"); for (n = args_opts_get_count("--line"); i < n; i++) - printf("%s\n", *(arr + i)); + printf("%s\n", *(arr + i) ? *(arr + i) : "(null)"); } if (args_opts_used("-L")) { i = 0; arr = args_opts_get("--Line"); for (n = args_opts_get_count("--Line"); i < n; i++) - printf("%s\n", *(arr + i)); + printf("%s\n", *(arr + i) ? *(arr + i) : "(null)"); } if (args_opts_used("--lines")) { -- cgit v1.2.3-70-g09d2