diff --git a/examples/sixdraw.c b/examples/sixdraw.c index 484fddd..7b754a0 100644 --- a/examples/sixdraw.c +++ b/examples/sixdraw.c @@ -211,6 +211,7 @@ init(struct sixdraw_ctx *ctx, int argc, char **argv) break; case '?': default: + fprintf(ctx->out_file, "%s\n", "Usage: sixdraw [-t timeout] [-c line-color]"); return false; } } diff --git a/tests/tcsgrep.c b/tests/tcsgrep.c index 0a5aca2..321e740 100644 --- a/tests/tcsgrep.c +++ b/tests/tcsgrep.c @@ -195,7 +195,7 @@ main(int argc, char **argv) break; case '?': default: - print_error(&ctx, "invalid arguments"); + fprintf(ctx.out_file, "%s\n", "Usage: tcsgrep [-t timeout] [-l limit] [-pv]"); return 1; } } @@ -366,11 +366,7 @@ main(int argc, char **argv) DEFSEQ_NOARGS(KEY_F12), }; size_t npatterns = sizeof(seqs) / sizeof(struct tcsgrep_sequence); - char const **patterns = malloc(sizeof(char const *) * npatterns); - if (patterns == NULL) { - print_error(&ctx, "failed to allocate memory"); - return 1; - } + char const *patterns[npatterns]; for (size_t idx = 0; idx < npatterns; ++idx) { patterns[idx] = seqs[idx].pattern; }