A variable shouldn't get assigned directly in an if statement. It's a discouraged code style because it's error prone (e.g. using assignment '=' where comparison '==' was desired) and difficult to detect.
Signed-off-by: Silvano Cirujano Cuesta <[email protected]> --- env/env_api_fat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/env/env_api_fat.c b/env/env_api_fat.c index 2b23e7f..c443408 100644 --- a/env/env_api_fat.c +++ b/env/env_api_fat.c @@ -67,7 +67,8 @@ bool read_env(CONFIG_PART *part, BG_ENVDATA *env) part->mountpoint); } FILE *config; - if (!(config = open_config_file(part, "rb"))) { + config = open_config_file(part, "rb"); + if (!config) { return false; } bool result = true; @@ -104,7 +105,8 @@ bool write_env(CONFIG_PART *part, BG_ENVDATA *env) part->mountpoint); } FILE *config; - if (!(config = open_config_file(part, "wb"))) { + config = open_config_file(part, "wb"); + if (!config) { VERBOSE(stderr, "Could not open config file for writing.\n"); return false; } -- 2.29.2 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/20201201123137.96569-3-silvano.cirujano-cuesta%40siemens.com.
