check required argument

iovec_array
YuQing 2021-05-20 16:49:53 +08:00
parent af7b8010f8
commit 02eaad6a89
1 changed files with 5 additions and 0 deletions

View File

@ -181,6 +181,11 @@ const char *sf_parse_daemon_mode_and_action_ex(int argc, char *argv[],
inc = match_option(argv[i], other_options);
if (inc > 0) {
i += inc;
if (i > argc) {
fprintf(stderr, "\nError: expect argument!\n");
sf_usage_ex(argv[0], other_options);
return NULL;
}
continue;
}
}