From 71f6b9b5cbf7ca1a86191e034fc3ba4584be4623 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 14 Jun 2012 10:32:50 +0800 Subject: [PATCH] sbverify: Use a variable for image filename ... rather than using argv[optind] multiple times. Signed-off-by: Jeremy Kerr --- sbverify.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sbverify.c b/sbverify.c index e472b1e..edf7d8c 100644 --- a/sbverify.c +++ b/sbverify.c @@ -180,7 +180,7 @@ static int x509_verify_cb(int status, X509_STORE_CTX *ctx) int main(int argc, char **argv) { - const char *detached_sig_filename; + const char *detached_sig_filename, *image_filename; enum verify_status status; int rc, c, flags, verify; const uint8_t *tmp_buf; @@ -233,9 +233,11 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - image = image_load(argv[optind]); + image_filename = argv[optind]; + + image = image_load(image_filename); if (!image) { - fprintf(stderr, "Can't open image %s\n", argv[optind]); + fprintf(stderr, "Can't open image %s\n", image_filename); return EXIT_FAILURE; } @@ -249,7 +251,7 @@ int main(int argc, char **argv) if (rc) { fprintf(stderr, "Unable to read signature data from %s\n", - detached_sig_filename ? : argv[optind]); + detached_sig_filename ? : image_filename); goto out; }