zkey: Fix -Wmaybe-uninitialized warnings in zkey-cryptsetup.c

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2020-06-04 10:02:40 +02:00
committed by Jan Höppner
parent f2f4dc209c
commit 798967aba3

View File

@@ -650,10 +650,10 @@ static int get_password_file(char **pwd, size_t *pwd_size, const char *key_file,
size_t file_read_size;
int regular_file = 0;
int char_to_read = 0;
size_t buflen = 0, i;
int fd, rc, newline;
char *pass = NULL;
int char_read = 0;
size_t buflen, i;
struct stat sb;
fd = key_file ? open(key_file, O_RDONLY) : STDIN_FILENO;
@@ -712,6 +712,7 @@ static int get_password_file(char **pwd, size_t *pwd_size, const char *key_file,
if (keyfile_offset && keyfile_seek(fd, keyfile_offset) < 0) {
warnx("Cannot seek to requested key file offset %lu",
keyfile_offset);
rc = -EIO;
goto out_err;
}