forked from pool/cryptsetup
93 lines
3.1 KiB
Diff
93 lines
3.1 KiB
Diff
fix some gcc warnings
|
|
|
|
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
|
|
|
|
Index: cryptsetup-luks-1.0.4_SVN30/lib/libdevmapper.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/lib/libdevmapper.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/lib/libdevmapper.c
|
|
@@ -258,7 +258,7 @@ static int dm_query_device(int details,
|
|
options->skip = 0;
|
|
options->size = length;
|
|
if (details) {
|
|
- char *cipher, *key_, *device, *tmp;
|
|
+ char *cipher, *key_, *device;
|
|
uint64_t val64;
|
|
|
|
set_error("Invalid dm table");
|
|
Index: cryptsetup-luks-1.0.4_SVN30/lib/setup.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/lib/setup.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/lib/setup.c
|
|
@@ -57,8 +57,6 @@ static int setup_enter(struct setup_back
|
|
|
|
static int setup_leave(struct setup_backend *backend)
|
|
{
|
|
- const char *error;
|
|
-
|
|
if (backend)
|
|
backend->exit();
|
|
|
|
Index: cryptsetup-luks-1.0.4_SVN30/lib/utils.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/lib/utils.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/lib/utils.c
|
|
@@ -173,7 +173,7 @@ ssize_t write_blockwise(int fd, const vo
|
|
{
|
|
char *padbuf; char *padbuf_base;
|
|
char *buf = (char *)orig_buf;
|
|
- int r;
|
|
+ int r = 0;
|
|
int hangover; int solid; int bsize;
|
|
|
|
if ((bsize = sector_size(fd)) < 0)
|
|
@@ -213,7 +213,7 @@ ssize_t write_blockwise(int fd, const vo
|
|
ssize_t read_blockwise(int fd, void *orig_buf, size_t count) {
|
|
char *padbuf; char *padbuf_base;
|
|
char *buf = (char *)orig_buf;
|
|
- int r;
|
|
+ int r = 0;
|
|
int step;
|
|
int bsize;
|
|
|
|
Index: cryptsetup-luks-1.0.4_SVN30/luks/keymanage.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/luks/keymanage.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/luks/keymanage.c
|
|
@@ -417,7 +417,7 @@ static int wipe(const char *device, unsi
|
|
int LUKS_del_key(const char *device, unsigned int keyIndex)
|
|
{
|
|
struct luks_phdr hdr;
|
|
- unsigned int i, startOffset, endOffset, stripesLen;
|
|
+ unsigned int startOffset, endOffset, stripesLen;
|
|
int r;
|
|
|
|
r = LUKS_read_phdr(device, &hdr);
|
|
Index: cryptsetup-luks-1.0.4_SVN30/luks/random.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/luks/random.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/luks/random.c
|
|
@@ -13,7 +13,7 @@
|
|
|
|
int getRandom(char *buf, size_t len)
|
|
{
|
|
- int randomfd, r = 0, index = 0;
|
|
+ int randomfd, r = 0;
|
|
|
|
//FIXME Run a FIPS test for the random device or include
|
|
// PRNG if urandom not avail.
|
|
Index: cryptsetup-luks-1.0.4_SVN30/src/cryptsetup.c
|
|
===================================================================
|
|
--- cryptsetup-luks-1.0.4_SVN30.orig/src/cryptsetup.c
|
|
+++ cryptsetup-luks-1.0.4_SVN30/src/cryptsetup.c
|
|
@@ -203,7 +203,8 @@ static int yesDialog(char *msg)
|
|
size_t size=0;
|
|
fprintf(stderr,"\nWARNING!\n========\n");
|
|
fprintf(stderr,"%s\n\nAre you sure? (Type uppercase yes): ",msg);
|
|
- getline(&answer,&size,stdin);
|
|
+ if(getline(&answer,&size,stdin) == -1)
|
|
+ return 0;
|
|
if(strcmp(answer,"YES\n") == 0)
|
|
r = 1;
|
|
free(answer);
|