From df8584da133c5e031fd0f672de5c3d954a286447 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Thu, 14 Jun 2018 21:22:52 -0500 Subject: [PATCH] mkfs: initialize return value of parse_config_stream to success Right now the return value is initialized to -1 (failure) and set to zero only if a valid token is found. However, this means that i.e. a blank or template config file containing only comments will yield failure on parsing. Initialize to success, and set to failure only if failure occurs. Signed-off-by: Eric Sandeen Reviewed-by: Carlos Maiolino Reviewed-by: Luis R. Rodriguez Reviewed-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- mkfs/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkfs/config.c b/mkfs/config.c index 835adc45f..1a2cd353c 100644 --- a/mkfs/config.c +++ b/mkfs/config.c @@ -385,7 +385,7 @@ parse_config_stream( const char *config_file, FILE *fp) { - int ret = -1; + int ret = 0; char *line = NULL; ssize_t linelen; size_t len = 0, lineno = 0; -- 2.47.2