mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl: fix -Wmaybe-uninitialized
Reported by GCC 9.2.1 when building with '-Wmaybe-uninitialized'.
job.c: In function 'job_get':
job.c:1817:14: warning: 'filename' may be used uninitialized in this function [-Wmaybe-uninitialized]
1817 | scan_size = scan_file(filename, &scan);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
job.c:1791:14: note: 'filename' was declared here
1791 | const char *filename;
| ^~~~~~~~
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
bbc46edaf5
commit
2790d4faaa
@@ -1788,7 +1788,7 @@ get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
|
||||
{
|
||||
struct scan_token* scan;
|
||||
struct scan_token* new_scan;
|
||||
const char *filename;
|
||||
const char *filename = NULL;
|
||||
char *blsdir;
|
||||
char* source;
|
||||
int i, rc, scan_size;
|
||||
@@ -1811,6 +1811,10 @@ get_job_from_config_file(struct command_line* cmdline, struct job_data* job)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (filename == NULL) {
|
||||
error_text("No zipl configuration was readable");
|
||||
return -1;
|
||||
}
|
||||
source = "";
|
||||
}
|
||||
printf("Using config file '%s'%s\n", filename, source);
|
||||
|
||||
Reference in New Issue
Block a user