Skip to content

Commit 14cb1ee

Browse files
qzedandersson
authored andcommitted
rmtfs: Fix command line argument parsing for '-o' optarg
Commit 2ee01bf ("storage: Try opening the slot-suffixed partition") introduced a bug where option '-o' is incorrectly specified as having no argument. Therefore, passing -o with a path incorrectly sets that path to the default '/boot' one as optarg evaluates to NULL. Fix this by telling getopt that we expect an argument. Fixes: 2ee01bf ("storage: Try opening the slot-suffixed partition") Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
1 parent f9847a7 commit 14cb1ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rmtfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ int main(int argc, char **argv)
505505
int option;
506506
const char *storage_root = NULL;
507507

508-
while ((option = getopt(argc, argv, "oS:Prsv")) != -1) {
508+
while ((option = getopt(argc, argv, "o:S:Prsv")) != -1) {
509509
switch (option) {
510510
/*
511511
* -o sets the directory where EFS images are stored,

0 commit comments

Comments
 (0)