mirror of
https://github.com/Genymobile/scrcpy
synced 2025-08-30 22:05:12 +00:00
Assert that long options are correctly set
This commit is contained in:
@@ -569,6 +569,10 @@ sc_getopt_adapter_create_longopts(void) {
|
|||||||
size_t out_idx = 0;
|
size_t out_idx = 0;
|
||||||
for (size_t i = 0; i < ARRAY_LEN(options); ++i) {
|
for (size_t i = 0; i < ARRAY_LEN(options); ++i) {
|
||||||
const struct sc_option *in = &options[i];
|
const struct sc_option *in = &options[i];
|
||||||
|
|
||||||
|
// If longopt_id is set, then longopt must be set
|
||||||
|
assert(!in->longopt_id || in->longopt);
|
||||||
|
|
||||||
if (!in->longopt) {
|
if (!in->longopt) {
|
||||||
// The longopts array must only contain long options
|
// The longopts array must only contain long options
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user