[PATCH v4][ 2/2] erofs-utils: fix error handler notes when parameter miss

Li Guifu blucerlee at gmail.com
Sat Oct 12 04:09:53 AEDT 2019


If a parameter isnot input, mkfs's error handler cannot give
a correct notes, fix it.

Signed-off-by: Li Guifu <blucerlee at gmail.com>
---
 mkfs/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/main.c b/mkfs/main.c
index 77a4b78..adfc79c 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -143,7 +143,7 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
 	if (!cfg.c_img_path)
 		return -ENOMEM;
 
-	if (optind > argc) {
+	if (optind >= argc) {
 		erofs_err("Source directory is missing");
 		return -EINVAL;
 	}
-- 
2.17.1



More information about the Linux-erofs mailing list