diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/argparser.c | 4 | ||||
-rw-r--r-- | 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); @@ -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")) { |