From a9bedca038090957ffdffa22d757df3ff6e86960 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 27 Mar 2015 17:03:44 +0100 Subject: [PATCH] fix some signed/unsigned warnings and style fixes --- comm.c | 2 +- libutil/crypt.c | 3 ++- nl.c | 4 ++-- sync.c | 2 +- unexpand.c | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/comm.c b/comm.c index ac60d0d..ee79047 100644 --- a/comm.c +++ b/comm.c @@ -68,7 +68,7 @@ main(int argc, char *argv[]) eprintf("getline %s:", argv[i]); if (diff && line[!i][0]) 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]); if (ferror(fp[!i])) eprintf("getline %s:", argv[!i]); diff --git a/libutil/crypt.c b/libutil/crypt.c index 7f76047..4591066 100644 --- a/libutil/crypt.c +++ b/libutil/crypt.c @@ -39,7 +39,8 @@ mdcheckline(const char *s, uint8_t *md, size_t sz) static void 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; size_t bufsiz = 0; int r; diff --git a/nl.c b/nl.c index e78c5dc..7609d5e 100644 --- a/nl.c +++ b/nl.c @@ -46,8 +46,8 @@ getsection(char *buf, int *section) static void nl(const char *fname, FILE *fp) { - size_t number = startnum, size = 0; - int donumber, oldsection, section = 1, bl = 1; + size_t number = startnum, size = 0, bl = 1; + int donumber, oldsection, section = 1; char *buf = NULL; while (getline(&buf, &size, fp) > 0) { diff --git a/sync.c b/sync.c index a766fbc..5d92233 100644 --- a/sync.c +++ b/sync.c @@ -6,7 +6,7 @@ static void usage(void) { - eprintf("usage: sync\n"); + eprintf("usage: %s\n", argv0); } int diff --git a/unexpand.c b/unexpand.c index c0f6d38..17dd532 100644 --- a/unexpand.c +++ b/unexpand.c @@ -7,7 +7,7 @@ static int aflag = 0; static size_t *tablist = NULL; -static int tablistlen = 8; +static size_t tablistlen = 8; static size_t parselist(const char *s)