Flag "output_to_file" not needed, since "envfilepath != NULL" only when
output to file requested.

Signed-off-by: Silvano Cirujano Cuesta <[email protected]>
---
 tools/bg_setenv.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/bg_setenv.c b/tools/bg_setenv.c
index 3d7329f..0395751 100644
--- a/tools/bg_setenv.c
+++ b/tools/bg_setenv.c
@@ -53,7 +53,6 @@ static struct argp_option options_printenv[] = {
     {0}};
 
 struct arguments {
-       bool output_to_file;
        int which_part;
 };
 
@@ -351,7 +350,6 @@ static error_t parse_opt(int key, char *arg, struct 
argp_state *state)
                                       (uint8_t *)arg, strlen(arg) + 1);
                break;
        case 'f':
-               arguments->output_to_file = true;
                res = asprintf(&envfilepath, "%s/%s", arg, FAT_ENV_FILENAME);
                if (res == -1) {
                        return ENOMEM;
@@ -557,7 +555,6 @@ int main(int argc, char **argv)
        }
 
        struct arguments arguments;
-       arguments.output_to_file = false;
        arguments.which_part = 0;
 
        STAILQ_INIT(&head);
@@ -573,7 +570,7 @@ int main(int argc, char **argv)
        /* arguments are parsed, journal is filled */
 
        /* is output to file ? */
-       if (arguments.output_to_file) {
+       if (envfilepath) {
                /* execute journal and write to file */
                BGENV env;
                BG_ENVDATA data;
-- 
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-4-silvano.cirujano-cuesta%40siemens.com.

Reply via email to