git: 8599e69d5697 - stable/13 - etdump: Fix the file name included in the could not open error message

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Tue, 25 Jan 2022 01:40:21 UTC
The branch stable/13 has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=8599e69d56970d5a22fd477af8d2eaa350e9e9ea

commit 8599e69d56970d5a22fd477af8d2eaa350e9e9ea
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2022-01-16 06:55:39 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2022-01-25 00:00:05 +0000

    etdump: Fix the file name included in the could not open error message
    
    If only one file is passed, this reads the terminating NULL and so
    prints (null). If multiple files are passed then this always prints the
    second file, which may or may not exist (and will be particularly
    confusing if it does exist since the output will include the dump of the
    second file).
    
    MFC after:      1 week
    
    (cherry picked from commit 340cebe9902d71e0b57dfa60af98504f5f71984d)
---
 usr.bin/etdump/etdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.bin/etdump/etdump.c b/usr.bin/etdump/etdump.c
index aedd53a9f6d1..e536aa5e51cb 100644
--- a/usr.bin/etdump/etdump.c
+++ b/usr.bin/etdump/etdump.c
@@ -262,7 +262,7 @@ main(int argc, char **argv)
 		} else {
 			iso = fopen(argv[i], "r");
 			if (iso == NULL)
-				err(1, "could not open %s", argv[1]);
+				err(1, "could not open %s", argv[i]);
 		}
 		dump_eltorito(iso, argv[i], outfile, outputter);
 	}