summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-11-04 15:00:44 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-11-04 15:00:44 +0200
commit8f40c029db2f6ad1650b5c0595b80e718028494d (patch)
tree7df876562f61d3a99cd077dee11ba43bdd78f92a /mysys
parent541b00a3bab34a34e2d5b3c7a5d6ba7645ff09a9 (diff)
downloadmariadb-git-8f40c029db2f6ad1650b5c0595b80e718028494d.tar.gz
Fix -Wmaybe-uninitialized
Follow-up to commit 8965ae27b9f011333dd1e2dc47db6e0514b5976a: always initialize found_group.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_default.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/mysys/my_default.c b/mysys/my_default.c
index d7e935d578b..8655cccf050 100644
--- a/mysys/my_default.c
+++ b/mysys/my_default.c
@@ -605,7 +605,7 @@ static int search_default_file_with_ext(struct handle_option_ctx *ctx,
const int max_recursion_level= 10;
MYSQL_FILE *fp;
uint line=0;
- enum { SKIP, PARSE, NONE } found_group;
+ enum { NONE, PARSE, SKIP } found_group= NONE;
uint i;
MY_DIR *search_dir;
FILEINFO *search_file;
@@ -749,16 +749,19 @@ static int search_default_file_with_ext(struct handle_option_ctx *ctx,
? PARSE : SKIP;
continue;
}
- if (found_group == NONE)
+ switch (found_group)
{
+ case NONE:
fprintf(stderr,
"error: Found option without preceding group in config file: %s at line: %d\n",
name,line);
goto err;
- }
- if (found_group == SKIP)
+ case PARSE:
+ break;
+ case SKIP:
continue;
-
+ }
+
end= remove_end_comment(ptr);
if ((value= strchr(ptr, '=')))
end= value;