From: mdw Date: Fri, 4 Aug 2000 23:23:44 +0000 (+0000) Subject: Various fixes. X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/commitdiff_plain/d470270aa476e8100eb78b1958ce5dd557983195 Various fixes. --- diff --git a/dsig.c b/dsig.c index eb70191..e591538 100644 --- a/dsig.c +++ b/dsig.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: dsig.c,v 1.3 2000/07/15 20:53:23 mdw Exp $ + * $Id: dsig.c,v 1.4 2000/08/04 23:23:44 mdw Exp $ * * Verify signatures on distribuitions of files * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: dsig.c,v $ + * Revision 1.4 2000/08/04 23:23:44 mdw + * Various fixes. + * * Revision 1.3 2000/07/15 20:53:23 mdw * More hash functions. Bug fix in getstring. * @@ -346,7 +349,7 @@ static int getstring(FILE *fp, dstr *d, unsigned raw) again: ch = getc(fp); - while (isspace((unsigned char)ch)) + while (isspace(ch)) ch = getc(fp); if (ch == '#') { do ch = getc(fp); while (ch != '\n' && ch != EOF); diff --git a/hashsum.c b/hashsum.c index 051fdb1..db7d7f7 100644 --- a/hashsum.c +++ b/hashsum.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: hashsum.c,v 1.3 2000/07/29 17:02:43 mdw Exp $ + * $Id: hashsum.c,v 1.4 2000/08/04 23:23:44 mdw Exp $ * * Hash files using some secure hash function * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: hashsum.c,v $ + * Revision 1.4 2000/08/04 23:23:44 mdw + * Various fixes. + * * Revision 1.3 2000/07/29 17:02:43 mdw * (checkhash): Be pettier about spaces between the hash and filename, for * compatiblity with `md5sum'. @@ -225,7 +228,7 @@ static int getstring(FILE *fp, const char *p, dstr *d, unsigned raw) /* --- Raw: just read exactly what's written up to a null byte --- */ -#define NEXTCH (fp ? getc(fp) : *p++) +#define NEXTCH (fp ? getc(fp) : (unsigned char)*p++) #define EOFCH (fp ? EOF : 0) if (raw) { @@ -249,7 +252,7 @@ static int getstring(FILE *fp, const char *p, dstr *d, unsigned raw) again: ch = NEXTCH; - while (isspace((unsigned char)ch)) + while (isspace(ch)) ch = NEXTCH; if (ch == '#') { do ch = NEXTCH; while (ch != '\n' && ch != EOFCH); @@ -298,7 +301,7 @@ again: if (ch == q) break; - if (!q && isspace((unsigned char)ch)) + if (!q && isspace(ch)) break; /* --- Otherwise contribute and continue --- */ diff --git a/mptext-dstr.c b/mptext-dstr.c index 112be2e..729c27e 100644 --- a/mptext-dstr.c +++ b/mptext-dstr.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mptext-dstr.c,v 1.2 1999/12/22 15:56:21 mdw Exp $ + * $Id: mptext-dstr.c,v 1.3 2000/08/04 23:23:44 mdw Exp $ * * Reading and writing large integers on strings * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: mptext-dstr.c,v $ + * Revision 1.3 2000/08/04 23:23:44 mdw + * Various fixes. + * * Revision 1.2 1999/12/22 15:56:21 mdw * Make the buffer passed to `put' op constant. * @@ -53,7 +56,7 @@ static int get(void *p) mptext_dstrctx *c = p; if (c->i >= c->d->len) return (EOF); - return (c->d->buf[c->i++]); + return ((unsigned char)c->d->buf[c->i++]); } static void unget(int ch, void *p) diff --git a/mptext-string.c b/mptext-string.c index d5b7248..ea734f8 100644 --- a/mptext-string.c +++ b/mptext-string.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mptext-string.c,v 1.2 1999/12/22 15:56:21 mdw Exp $ + * $Id: mptext-string.c,v 1.3 2000/08/04 23:23:44 mdw Exp $ * * Reading and writing large integers on strings * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: mptext-string.c,v $ + * Revision 1.3 2000/08/04 23:23:44 mdw + * Various fixes. + * * Revision 1.2 1999/12/22 15:56:21 mdw * Make the buffer passed to `put' op constant. * @@ -53,7 +56,7 @@ static int get(void *p) mptext_stringctx *c = p; if (c->buf >= c->lim) return (EOF); - return (*c->buf++); + return ((unsigned char)*c->buf++); } static void unget(int ch, void *p)