fix some signed/unsigned warnings and style fixes

This commit is contained in:
Hiltjo Posthuma 2015-03-27 17:03:44 +01:00
parent 57dc7b94b0
commit a9bedca038
5 changed files with 7 additions and 6 deletions

2
comm.c
View File

@ -68,7 +68,7 @@ main(int argc, char *argv[])
eprintf("getline %s:", argv[i]); eprintf("getline %s:", argv[i]);
if (diff && line[!i][0]) if (diff && line[!i][0])
printline(!i, line[!i]); printline(!i, line[!i]);
while (getline(&line[!i], &linelen[!i], fp[!i]) >= 0) while (getline(&line[!i], &linelen[!i], fp[!i]) > 0)
printline(!i, line[!i]); printline(!i, line[!i]);
if (ferror(fp[!i])) if (ferror(fp[!i]))
eprintf("getline %s:", argv[!i]); eprintf("getline %s:", argv[!i]);

View File

@ -39,7 +39,8 @@ mdcheckline(const char *s, uint8_t *md, size_t sz)
static void static void
mdchecklist(FILE *listfp, struct crypt_ops *ops, uint8_t *md, size_t sz, mdchecklist(FILE *listfp, struct crypt_ops *ops, uint8_t *md, size_t sz,
int *formatsucks, int *noread, int *nonmatch) { int *formatsucks, int *noread, int *nonmatch)
{
FILE *fp; FILE *fp;
size_t bufsiz = 0; size_t bufsiz = 0;
int r; int r;

4
nl.c
View File

@ -46,8 +46,8 @@ getsection(char *buf, int *section)
static void static void
nl(const char *fname, FILE *fp) nl(const char *fname, FILE *fp)
{ {
size_t number = startnum, size = 0; size_t number = startnum, size = 0, bl = 1;
int donumber, oldsection, section = 1, bl = 1; int donumber, oldsection, section = 1;
char *buf = NULL; char *buf = NULL;
while (getline(&buf, &size, fp) > 0) { while (getline(&buf, &size, fp) > 0) {

2
sync.c
View File

@ -6,7 +6,7 @@
static void static void
usage(void) usage(void)
{ {
eprintf("usage: sync\n"); eprintf("usage: %s\n", argv0);
} }
int int

View File

@ -7,7 +7,7 @@
static int aflag = 0; static int aflag = 0;
static size_t *tablist = NULL; static size_t *tablist = NULL;
static int tablistlen = 8; static size_t tablistlen = 8;
static size_t static size_t
parselist(const char *s) parselist(const char *s)