Update sixdraw and tcsgrep.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
CismonX 2021-02-03 03:44:24 +08:00
parent fdc056ed92
commit e84a949673
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
2 changed files with 3 additions and 6 deletions

View File

@ -211,6 +211,7 @@ init(struct sixdraw_ctx *ctx, int argc, char **argv)
break; break;
case '?': case '?':
default: default:
fprintf(ctx->out_file, "%s\n", "Usage: sixdraw [-t timeout] [-c line-color]");
return false; return false;
} }
} }

View File

@ -195,7 +195,7 @@ main(int argc, char **argv)
break; break;
case '?': case '?':
default: default:
print_error(&ctx, "invalid arguments"); fprintf(ctx.out_file, "%s\n", "Usage: tcsgrep [-t timeout] [-l limit] [-pv]");
return 1; return 1;
} }
} }
@ -366,11 +366,7 @@ main(int argc, char **argv)
DEFSEQ_NOARGS(KEY_F12), DEFSEQ_NOARGS(KEY_F12),
}; };
size_t npatterns = sizeof(seqs) / sizeof(struct tcsgrep_sequence); size_t npatterns = sizeof(seqs) / sizeof(struct tcsgrep_sequence);
char const **patterns = malloc(sizeof(char const *) * npatterns); char const *patterns[npatterns];
if (patterns == NULL) {
print_error(&ctx, "failed to allocate memory");
return 1;
}
for (size_t idx = 0; idx < npatterns; ++idx) { for (size_t idx = 0; idx < npatterns; ++idx) {
patterns[idx] = seqs[idx].pattern; patterns[idx] = seqs[idx].pattern;
} }