fix: dont allow empty values in string args
This commit is contained in:
@@ -159,8 +159,14 @@ void args_parse(Parameters *params, int argc, char **argv) {
|
||||
puts(PACKAGE " " VERSION);
|
||||
exit(EXIT_SUCCESS);
|
||||
} else if (is_arg(arg, "-p") || is_arg(arg, "--project")) {
|
||||
if (strlen(value) == 0) {
|
||||
invalid_value(arg, value);
|
||||
}
|
||||
strlcpy(params->project_path, value, STR_LEN);
|
||||
} else if (is_arg(arg, "-c") || is_arg(arg, "--config")) {
|
||||
if (strlen(value) == 0) {
|
||||
invalid_value(arg, value);
|
||||
}
|
||||
strlcpy(params->config_file, value, STR_LEN);
|
||||
} else if (is_arg(arg, "-hr") || is_arg(arg, "--hot-reload")) {
|
||||
params->hot_reload = true;
|
||||
@@ -218,6 +224,9 @@ void args_parse(Parameters *params, int argc, char **argv) {
|
||||
log_error("maximum video input reached");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (strlen(value) == 0) {
|
||||
invalid_value(arg, value);
|
||||
}
|
||||
strlcpy(params->video_in.values[params->video_in.length++], value,
|
||||
STR_LEN);
|
||||
} else if (is_arg(arg, "-vb") || is_arg(arg, "--video-buffers")) {
|
||||
|
||||
Reference in New Issue
Block a user