Skip to content

Commit

Permalink
loader: Do not repeat strlen(options) condition
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Dec 27, 2021
1 parent 9f9d4d8 commit ca8ccef
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,15 @@ struct evmc_vm* evmc_load_and_configure(const char* config, enum evmc_loader_err
if (!vm)
return NULL;

if (vm->set_option == NULL && strlen(options) != 0)
{
ec = set_error(EVMC_LOADER_INVALID_OPTION_NAME, "%s (%s) does not support any options",
vm->name, path);
goto exit;
}


while (strlen(options) != 0)
{
if (vm->set_option == NULL)
{
ec = set_error(EVMC_LOADER_INVALID_OPTION_NAME, "%s (%s) does not support any options",
vm->name, path);
goto exit;
}

char* option = get_token(&options, ',');

// Slit option into name and value by taking the name token.
Expand Down

0 comments on commit ca8ccef

Please sign in to comment.