commit bdc246277847e76391580b8e7f63f24633f25b80
parent 7e4632aeee13de4ef16f0f2c026d2fee46516815
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Wed, 23 Dec 2020 13:22:31 -0800
Use badargs() in cextern()
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/main.c b/main.c
@@ -501,10 +501,8 @@ cextern(int argc, const char **argv, int index, const char **item)
char url[MY_URL_MAX];
int i;
- if (argc == 0) {
- warnx("%s: Not enough arguments.", __func__);
+ if (badargs(1, -1, argc, argv))
return 1;
- }
snprintf(url, sizeof(url), "%s/%s", item[GI_HOST], item[GI_PATH]);
for (i = 0; i < argc; ++i)