[PATCH] erofs-utils: fix up "-E legacy-compress" option

Gao Xiang hsiangkao at aol.com
Tue Aug 27 01:32:30 AEST 2019


"-E legacy-compress" isn't parsed properly, fix it now.

Signed-off-by: Gao Xiang <hsiangkao at aol.com>
---
 mkfs/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/main.c b/mkfs/main.c
index 75e1d47..5efbf30 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -34,7 +34,7 @@ static void usage(void)
 static int parse_extended_opts(const char *opts)
 {
 #define MATCH_EXTENTED_OPT(opt, token, keylen) \
-	(keylen == sizeof(opt) && !memcmp(token, opt, sizeof(opt)))
+	(keylen == sizeof(opt) - 1 && !memcmp(token, opt, sizeof(opt) - 1))
 
 	const char *token, *next, *tokenend, *value __maybe_unused;
 	unsigned int keylen, vallen;
-- 
2.17.1



More information about the Linux-erofs mailing list