From 6be763e68183071b37f6029b9bf05bb7c9c164c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 22 Dec 2021 22:33:01 +0100 Subject: [PATCH] loader: Do not repeat strlen(options) condition --- lib/loader/loader.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/loader/loader.c b/lib/loader/loader.c index 5b8b3c3a2..079270018 100644 --- a/lib/loader/loader.c +++ b/lib/loader/loader.c @@ -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.