Thanks to Ivan Stankovic

* write_lseek_blockwise: declare innerCount outside the if block
* add -Wall to the default CFLAGS
* fix some signedness issues



git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@29 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
Clemens Fruhwirth
2008-09-01 08:54:05 +00:00
parent 4884064723
commit 98cf0aedf8
7 changed files with 16 additions and 10 deletions

View File

@@ -230,14 +230,13 @@ ssize_t write_lseek_blockwise(int fd, const char *buf, size_t count, off_t offse
char frontPadBuf[bsize];
int frontHang = offset % bsize;
int r;
int innerCount = count < bsize ? count : bsize;
if (bsize < 0)
return bsize;
lseek(fd, offset - frontHang, SEEK_SET);
if(offset % bsize) {
int innerCount = count<bsize?count:bsize;
r = read(fd,frontPadBuf,bsize);
if(r < 0) return -1;
@@ -346,7 +345,8 @@ out_err:
* reading can be retried as for interactive terminals).
*/
int get_key(char *prompt, char **key, int *passLen, int key_size, const char *key_file, int passphrase_fd, int timeout, int how2verify)
int get_key(char *prompt, char **key, unsigned int *passLen, int key_size,
const char *key_file, int passphrase_fd, int timeout, int how2verify)
{
int fd;
const int verify = how2verify & CRYPT_FLAG_VERIFY;