changeset 40:ca7899d47629 default tip master

format
author ng0@n0.is
date Fri, 25 Oct 2019 10:58:18 +0000
parents 8bb1d101c166
children
files cache.h compats.c cvs_direct.c cvsps.c cvsps.h tests.c util.h
diffstat 7 files changed, 809 insertions(+), 731 deletions(-) [+]
line wrap: on
line diff
--- a/cache.h	Fri Oct 25 10:45:36 2019 +0000
+++ b/cache.h	Fri Oct 25 10:58:18 2019 +0000
@@ -6,7 +6,8 @@
 #ifndef CACHE_H
 #define CACHE_H
 
-extern time_t read_cache (void);
+extern time_t
+read_cache (void);
 extern void write_cache (time_t);
 
 #endif /* CACHE_H */
--- a/compats.c	Fri Oct 25 10:45:36 2019 +0000
+++ b/compats.c	Fri Oct 25 10:58:18 2019 +0000
@@ -1,5 +1,5 @@
 #include "config.h"
-#if !HAVE_ERR
+#if ! HAVE_ERR
 /*
  * Copyright (c) 1993
  *      The Regents of the University of California.  All rights reserved.
@@ -36,70 +36,70 @@
 #include <string.h>
 
 void
-vwarnx(const char *fmt, va_list ap)
+vwarnx (const char *fmt, va_list ap)
 {
-	fprintf(stderr, "%s: ", getprogname());
-	if (fmt != NULL)
-		vfprintf(stderr, fmt, ap);
+        fprintf (stderr, "%s: ", getprogname ());
+        if (fmt != NULL)
+                vfprintf (stderr, fmt, ap);
 }
 
 void
-vwarn(const char *fmt, va_list ap)
+vwarn (const char *fmt, va_list ap)
 {
-	int sverrno;
+        int sverrno;
 
-	sverrno = errno;
-	vwarnx(fmt, ap);
-	if (fmt != NULL)
-		fputs(": ", stderr);
-	fprintf(stderr, "%s\n", strerror(sverrno));
+        sverrno = errno;
+        vwarnx (fmt, ap);
+        if (fmt != NULL)
+                fputs (": ", stderr);
+        fprintf (stderr, "%s\n", strerror (sverrno));
 }
 
 void
-err(int eval, const char *fmt, ...)
+err (int eval, const char *fmt, ...)
 {
-	va_list ap;
+        va_list ap;
 
-	va_start(ap, fmt);
-	vwarn(fmt, ap);
-	va_end(ap);
-	exit(eval);
+        va_start (ap, fmt);
+        vwarn (fmt, ap);
+        va_end (ap);
+        exit (eval);
 }
 
 void
-errx(int eval, const char *fmt, ...)
+errx (int eval, const char *fmt, ...)
 {
-	va_list ap;
+        va_list ap;
 
-	va_start(ap, fmt);
-	vwarnx(fmt, ap);
-	va_end(ap);
-	fputc('\n', stderr);
-	exit(eval);
+        va_start (ap, fmt);
+        vwarnx (fmt, ap);
+        va_end (ap);
+        fputc ('\n', stderr);
+        exit (eval);
 }
 
 void
-warn(const char *fmt, ...)
+warn (const char *fmt, ...)
 {
-	va_list ap;
+        va_list ap;
 
-	va_start(ap, fmt);
-	vwarn(fmt, ap);
-	va_end(ap);
+        va_start (ap, fmt);
+        vwarn (fmt, ap);
+        va_end (ap);
 }
 
 void
-warnx(const char *fmt, ...)
+warnx (const char *fmt, ...)
 {
-	va_list ap;
+        va_list ap;
 
-	va_start(ap, fmt);
-	vwarnx(fmt, ap);
-	va_end(ap);
-	fputc('\n', stderr);
+        va_start (ap, fmt);
+        vwarnx (fmt, ap);
+        va_end (ap);
+        fputc ('\n', stderr);
 }
 #endif /* !HAVE_ERR */
-#if !HAVE_B64_NTOP
+#if ! HAVE_B64_NTOP
 /*	$OpenBSD$	*/
 
 /*
@@ -158,7 +158,7 @@
 #include <string.h>
 
 static const char b64_Base64[] =
-	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 static const char b64_Pad64 = '=';
 
 /* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
@@ -209,73 +209,75 @@
    end of the data is performed using the '=' character.
 
    Since all base64 input is an integral number of octets, only the
-         -------------------------------------------------                       
+         -------------------------------------------------
    following cases can arise:
-   
+
        (1) the final quantum of encoding input is an integral
            multiple of 24 bits; here, the final unit of encoded
-	   output will be an integral multiple of 4 characters
-	   with no "=" padding,
+     output will be an integral multiple of 4 characters
+     with no "=" padding,
        (2) the final quantum of encoding input is exactly 8 bits;
            here, the final unit of encoded output will be two
-	   characters followed by two "=" padding characters, or
+     characters followed by two "=" padding characters, or
        (3) the final quantum of encoding input is exactly 16 bits;
            here, the final unit of encoded output will be three
-	   characters followed by one "=" padding character.
+     characters followed by one "=" padding character.
    */
 
 int
-b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize)
+b64_ntop (u_char const *src, size_t srclength, char *target, size_t targsize)
 {
-	size_t datalength = 0;
-	u_char input[3];
-	u_char output[4];
-	size_t i;
+        size_t datalength = 0;
+        u_char input[3];
+        u_char output[4];
+        size_t i;
 
-	while (2 < srclength) {
-		input[0] = *src++;
-		input[1] = *src++;
-		input[2] = *src++;
-		srclength -= 3;
+        while (2 < srclength)
+        {
+                input[0] = *src++;
+                input[1] = *src++;
+                input[2] = *src++;
+                srclength -= 3;
 
-		output[0] = input[0] >> 2;
-		output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
-		output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
-		output[3] = input[2] & 0x3f;
+                output[0] = input[0] >> 2;
+                output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+                output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+                output[3] = input[2] & 0x3f;
+
+                if (datalength + 4 > targsize)
+                        return (-1);
+                target[datalength++] = b64_Base64[output[0]];
+                target[datalength++] = b64_Base64[output[1]];
+                target[datalength++] = b64_Base64[output[2]];
+                target[datalength++] = b64_Base64[output[3]];
+        }
 
-		if (datalength + 4 > targsize)
-			return (-1);
-		target[datalength++] = b64_Base64[output[0]];
-		target[datalength++] = b64_Base64[output[1]];
-		target[datalength++] = b64_Base64[output[2]];
-		target[datalength++] = b64_Base64[output[3]];
-	}
-    
-	/* Now we worry about padding. */
-	if (0 != srclength) {
-		/* Get what's left. */
-		input[0] = input[1] = input[2] = '\0';
-		for (i = 0; i < srclength; i++)
-			input[i] = *src++;
-	
-		output[0] = input[0] >> 2;
-		output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
-		output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+        /* Now we worry about padding. */
+        if (0 != srclength)
+        {
+                /* Get what's left. */
+                input[0] = input[1] = input[2] = '\0';
+                for (i = 0; i < srclength; i++)
+                        input[i] = *src++;
+
+                output[0] = input[0] >> 2;
+                output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+                output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
 
-		if (datalength + 4 > targsize)
-			return (-1);
-		target[datalength++] = b64_Base64[output[0]];
-		target[datalength++] = b64_Base64[output[1]];
-		if (srclength == 1)
-			target[datalength++] = b64_Pad64;
-		else
-			target[datalength++] = b64_Base64[output[2]];
-		target[datalength++] = b64_Pad64;
-	}
-	if (datalength >= targsize)
-		return (-1);
-	target[datalength] = '\0';	/* Returned value doesn't count \0. */
-	return (datalength);
+                if (datalength + 4 > targsize)
+                        return (-1);
+                target[datalength++] = b64_Base64[output[0]];
+                target[datalength++] = b64_Base64[output[1]];
+                if (srclength == 1)
+                        target[datalength++] = b64_Pad64;
+                else
+                        target[datalength++] = b64_Base64[output[2]];
+                target[datalength++] = b64_Pad64;
+        }
+        if (datalength >= targsize)
+                return (-1);
+        target[datalength] = '\0'; /* Returned value doesn't count \0. */
+        return (datalength);
 }
 
 /* skips all whitespace anywhere.
@@ -285,132 +287,142 @@
  */
 
 int
-b64_pton(char const *src, u_char *target, size_t targsize)
+b64_pton (char const *src, u_char *target, size_t targsize)
 {
-	int state, ch;
-	size_t tarindex;
-	u_char nextbyte;
-	char *pos;
+        int state, ch;
+        size_t tarindex;
+        u_char nextbyte;
+        char *pos;
 
-	state = 0;
-	tarindex = 0;
+        state = 0;
+        tarindex = 0;
 
-	while ((ch = (unsigned char)*src++) != '\0') {
-		if (isspace(ch))	/* Skip whitespace anywhere. */
-			continue;
+        while ((ch = (unsigned char) *src++) != '\0')
+        {
+                if (isspace (ch)) /* Skip whitespace anywhere. */
+                        continue;
 
-		if (ch == b64_Pad64)
-			break;
+                if (ch == b64_Pad64)
+                        break;
 
-		pos = strchr(b64_Base64, ch);
-		if (pos == 0) 		/* A non-base64 character. */
-			return (-1);
+                pos = strchr (b64_Base64, ch);
+                if (pos == 0) /* A non-base64 character. */
+                        return (-1);
 
-		switch (state) {
-		case 0:
-			if (target) {
-				if (tarindex >= targsize)
-					return (-1);
-				target[tarindex] = (pos - b64_Base64) << 2;
-			}
-			state = 1;
-			break;
-		case 1:
-			if (target) {
-				if (tarindex >= targsize)
-					return (-1);
-				target[tarindex]   |=  (pos - b64_Base64) >> 4;
-				nextbyte = ((pos - b64_Base64) & 0x0f) << 4;
-				if (tarindex + 1 < targsize)
-					target[tarindex+1] = nextbyte;
-				else if (nextbyte)
-					return (-1);
-			}
-			tarindex++;
-			state = 2;
-			break;
-		case 2:
-			if (target) {
-				if (tarindex >= targsize)
-					return (-1);
-				target[tarindex]   |=  (pos - b64_Base64) >> 2;
-				nextbyte = ((pos - b64_Base64) & 0x03) << 6;
-				if (tarindex + 1 < targsize)
-					target[tarindex+1] = nextbyte;
-				else if (nextbyte)
-					return (-1);
-			}
-			tarindex++;
-			state = 3;
-			break;
-		case 3:
-			if (target) {
-				if (tarindex >= targsize)
-					return (-1);
-				target[tarindex] |= (pos - b64_Base64);
-			}
-			tarindex++;
-			state = 0;
-			break;
-		}
-	}
+                switch (state)
+                {
+                case 0:
+                        if (target)
+                        {
+                                if (tarindex >= targsize)
+                                        return (-1);
+                                target[tarindex] = (pos - b64_Base64) << 2;
+                        }
+                        state = 1;
+                        break;
+                case 1:
+                        if (target)
+                        {
+                                if (tarindex >= targsize)
+                                        return (-1);
+                                target[tarindex] |= (pos - b64_Base64) >> 4;
+                                nextbyte = ((pos - b64_Base64) & 0x0f) << 4;
+                                if (tarindex + 1 < targsize)
+                                        target[tarindex + 1] = nextbyte;
+                                else if (nextbyte)
+                                        return (-1);
+                        }
+                        tarindex++;
+                        state = 2;
+                        break;
+                case 2:
+                        if (target)
+                        {
+                                if (tarindex >= targsize)
+                                        return (-1);
+                                target[tarindex] |= (pos - b64_Base64) >> 2;
+                                nextbyte = ((pos - b64_Base64) & 0x03) << 6;
+                                if (tarindex + 1 < targsize)
+                                        target[tarindex + 1] = nextbyte;
+                                else if (nextbyte)
+                                        return (-1);
+                        }
+                        tarindex++;
+                        state = 3;
+                        break;
+                case 3:
+                        if (target)
+                        {
+                                if (tarindex >= targsize)
+                                        return (-1);
+                                target[tarindex] |= (pos - b64_Base64);
+                        }
+                        tarindex++;
+                        state = 0;
+                        break;
+                }
+        }
 
-	/*
-	 * We are done decoding Base-64 chars.  Let's see if we ended
-	 * on a byte boundary, and/or with erroneous trailing characters.
-	 */
-
-	if (ch == b64_Pad64) {			/* We got a pad char. */
-		ch = (unsigned char)*src++;	/* Skip it, get next. */
-		switch (state) {
-		case 0:		/* Invalid = in first position */
-		case 1:		/* Invalid = in second position */
-			return (-1);
+        /*
+         * We are done decoding Base-64 chars.  Let's see if we ended
+         * on a byte boundary, and/or with erroneous trailing characters.
+         */
 
-		case 2:		/* Valid, means one byte of info */
-			/* Skip any number of spaces. */
-			for (; ch != '\0'; ch = (unsigned char)*src++)
-				if (!isspace(ch))
-					break;
-			/* Make sure there is another trailing = sign. */
-			if (ch != b64_Pad64)
-				return (-1);
-			ch = (unsigned char)*src++;		/* Skip the = */
-			/* Fall through to "single trailing =" case. */
-			/* FALLTHROUGH */
+        if (ch == b64_Pad64)
+        { /* We got a pad char. */
+                ch = (unsigned char) *src++; /* Skip it, get next. */
+                switch (state)
+                {
+                case 0: /* Invalid = in first position */
+                case 1: /* Invalid = in second position */
+                        return (-1);
+
+                case 2: /* Valid, means one byte of info */
+                        /* Skip any number of spaces. */
+                        for (; ch != '\0'; ch = (unsigned char) *src++)
+                                if (! isspace (ch))
+                                        break;
+                        /* Make sure there is another trailing = sign. */
+                        if (ch != b64_Pad64)
+                                return (-1);
+                        ch = (unsigned char) *src++; /* Skip the = */
+                        /* Fall through to "single trailing =" case. */
+                        /* FALLTHROUGH */
 
-		case 3:		/* Valid, means two bytes of info */
-			/*
-			 * We know this char is an =.  Is there anything but
-			 * whitespace after it?
-			 */
-			for (; ch != '\0'; ch = (unsigned char)*src++)
-				if (!isspace(ch))
-					return (-1);
+                case 3: /* Valid, means two bytes of info */
+                        /*
+                         * We know this char is an =.  Is there anything but
+                         * whitespace after it?
+                         */
+                        for (; ch != '\0'; ch = (unsigned char) *src++)
+                                if (! isspace (ch))
+                                        return (-1);
 
-			/*
-			 * Now make sure for cases 2 and 3 that the "extra"
-			 * bits that slopped past the last full byte were
-			 * zeros.  If we don't check them, they become a
-			 * subliminal channel.
-			 */
-			if (target && tarindex < targsize &&
-			    target[tarindex] != 0)
-				return (-1);
-		}
-	} else {
-		/*
-		 * We ended by seeing the end of the string.  Make sure we
-		 * have no partial bytes lying around.
-		 */
-		if (state != 0)
-			return (-1);
-	}
+                        /*
+                         * Now make sure for cases 2 and 3 that the "extra"
+                         * bits that slopped past the last full byte were
+                         * zeros.  If we don't check them, they become a
+                         * subliminal channel.
+                         */
+                        if (target && tarindex < targsize &&
+                            target[tarindex] != 0)
+                                return (-1);
+                }
+        }
+        else
+        {
+                /*
+                 * We ended by seeing the end of the string.  Make sure we
+                 * have no partial bytes lying around.
+                 */
+                if (state != 0)
+                        return (-1);
+        }
 
-	return (tarindex);
+        return (tarindex);
 }
 #endif /* !HAVE_B64_NTOP */
-#if !HAVE_EXPLICIT_BZERO
+#if ! HAVE_EXPLICIT_BZERO
 /* OPENBSD ORIGINAL: lib/libc/string/explicit_bzero.c */
 /*
  * Public domain.
@@ -426,11 +438,11 @@
 #if HAVE_MEMSET_S
 
 void
-explicit_bzero(void *p, size_t n)
+explicit_bzero (void *p, size_t n)
 {
-	if (n == 0)
-		return;
-	(void)memset_s(p, n, 0, n);
+        if (n == 0)
+                return;
+        (void) memset_s (p, n, 0, n);
 }
 
 #else /* HAVE_MEMSET_S */
@@ -439,30 +451,31 @@
  * Indirect bzero through a volatile pointer to hopefully avoid
  * dead-store optimisation eliminating the call.
  */
-static void (* volatile ssh_bzero)(void *, size_t) = bzero;
+static void (*volatile ssh_bzero) (void *, size_t) = bzero;
 
 void
-explicit_bzero(void *p, size_t n)
+explicit_bzero (void *p, size_t n)
 {
-	if (n == 0)
-		return;
-	/*
-	 * clang -fsanitize=memory needs to intercept memset-like functions
-	 * to correctly detect memory initialisation. Make sure one is called
-	 * directly since our indirection trick above sucessfully confuses it.
-	 */
+        if (n == 0)
+                return;
+                /*
+                 * clang -fsanitize=memory needs to intercept memset-like
+                 * functions to correctly detect memory initialisation. Make
+                 * sure one is called directly since our indirection trick above
+                 * sucessfully confuses it.
+                 */
 #if defined(__has_feature)
-# if __has_feature(memory_sanitizer)
-	memset(p, 0, n);
-# endif
+#if __has_feature(memory_sanitizer)
+        memset (p, 0, n);
+#endif
 #endif
 
-	ssh_bzero(p, n);
+        ssh_bzero (p, n);
 }
 
 #endif /* HAVE_MEMSET_S */
 #endif /* !HAVE_EXPLICIT_BZERO */
-#if !HAVE_GETPROGNAME
+#if ! HAVE_GETPROGNAME
 /*
  * Copyright (c) 2016 Nicholas Marriott <nicholas.marriott@gmail.com>
  * Copyright (c) 2017 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -486,23 +499,23 @@
 
 #if HAVE_PROGRAM_INVOCATION_SHORT_NAME
 const char *
-getprogname(void)
+getprogname (void)
 {
-	return (program_invocation_short_name);
+        return (program_invocation_short_name);
 }
 #elif HAVE___PROGNAME
 const char *
-getprogname(void)
+getprogname (void)
 {
-	extern char	*__progname;
+        extern char *__progname;
 
-	return (__progname);
+        return (__progname);
 }
 #else
 #error No getprogname available.
 #endif
 #endif /* !HAVE_GETPROGNAME */
-#if !HAVE_MD5
+#if ! HAVE_MD5
 /*
  * This code implements the MD5 message-digest algorithm.
  * The algorithm is due to Ron Rivest.	This code was
@@ -524,40 +537,47 @@
 #include <stdlib.h>
 #include <string.h>
 
-#define PUT_64BIT_LE(cp, value) do {					\
-	(cp)[7] = (value) >> 56;					\
-	(cp)[6] = (value) >> 48;					\
-	(cp)[5] = (value) >> 40;					\
-	(cp)[4] = (value) >> 32;					\
-	(cp)[3] = (value) >> 24;					\
-	(cp)[2] = (value) >> 16;					\
-	(cp)[1] = (value) >> 8;						\
-	(cp)[0] = (value); } while (0)
+#define PUT_64BIT_LE(cp, value)          \
+        do                               \
+        {                                \
+                (cp)[7] = (value) >> 56; \
+                (cp)[6] = (value) >> 48; \
+                (cp)[5] = (value) >> 40; \
+                (cp)[4] = (value) >> 32; \
+                (cp)[3] = (value) >> 24; \
+                (cp)[2] = (value) >> 16; \
+                (cp)[1] = (value) >> 8;  \
+                (cp)[0] = (value);       \
+        } while (0)
 
-#define PUT_32BIT_LE(cp, value) do {					\
-	(cp)[3] = (value) >> 24;					\
-	(cp)[2] = (value) >> 16;					\
-	(cp)[1] = (value) >> 8;						\
-	(cp)[0] = (value); } while (0)
+#define PUT_32BIT_LE(cp, value)          \
+        do                               \
+        {                                \
+                (cp)[3] = (value) >> 24; \
+                (cp)[2] = (value) >> 16; \
+                (cp)[1] = (value) >> 8;  \
+                (cp)[0] = (value);       \
+        } while (0)
 
-static u_int8_t PADDING[MD5_BLOCK_LENGTH] = {
-	0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
+static u_int8_t PADDING[MD5_BLOCK_LENGTH] = {0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                                             0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                                             0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                                             0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                                             0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+                                             0,    0, 0, 0, 0, 0, 0, 0, 0};
 
 /*
  * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
  * initialization constants.
  */
 void
-MD5Init(MD5_CTX *ctx)
+MD5Init (MD5_CTX *ctx)
 {
-	ctx->count = 0;
-	ctx->state[0] = 0x67452301;
-	ctx->state[1] = 0xefcdab89;
-	ctx->state[2] = 0x98badcfe;
-	ctx->state[3] = 0x10325476;
+        ctx->count = 0;
+        ctx->state[0] = 0x67452301;
+        ctx->state[1] = 0xefcdab89;
+        ctx->state[2] = 0x98badcfe;
+        ctx->state[3] = 0x10325476;
 }
 
 /*
@@ -565,37 +585,40 @@
  * of bytes.
  */
 void
-MD5Update(MD5_CTX *ctx, const unsigned char *input, size_t len)
+MD5Update (MD5_CTX *ctx, const unsigned char *input, size_t len)
 {
-	size_t have, need;
+        size_t have, need;
 
-	/* Check how many bytes we already have and how many more we need. */
-	have = (size_t)((ctx->count >> 3) & (MD5_BLOCK_LENGTH - 1));
-	need = MD5_BLOCK_LENGTH - have;
+        /* Check how many bytes we already have and how many more we need. */
+        have = (size_t) ((ctx->count >> 3) & (MD5_BLOCK_LENGTH - 1));
+        need = MD5_BLOCK_LENGTH - have;
 
-	/* Update bitcount */
-	ctx->count += (u_int64_t)len << 3;
+        /* Update bitcount */
+        ctx->count += (u_int64_t) len << 3;
 
-	if (len >= need) {
-		if (have != 0) {
-			memcpy(ctx->buffer + have, input, need);
-			MD5Transform(ctx->state, ctx->buffer);
-			input += need;
-			len -= need;
-			have = 0;
-		}
+        if (len >= need)
+        {
+                if (have != 0)
+                {
+                        memcpy (ctx->buffer + have, input, need);
+                        MD5Transform (ctx->state, ctx->buffer);
+                        input += need;
+                        len -= need;
+                        have = 0;
+                }
 
-		/* Process data in MD5_BLOCK_LENGTH-byte chunks. */
-		while (len >= MD5_BLOCK_LENGTH) {
-			MD5Transform(ctx->state, input);
-			input += MD5_BLOCK_LENGTH;
-			len -= MD5_BLOCK_LENGTH;
-		}
-	}
+                /* Process data in MD5_BLOCK_LENGTH-byte chunks. */
+                while (len >= MD5_BLOCK_LENGTH)
+                {
+                        MD5Transform (ctx->state, input);
+                        input += MD5_BLOCK_LENGTH;
+                        len -= MD5_BLOCK_LENGTH;
+                }
+        }
 
-	/* Handle any remaining bytes of data. */
-	if (len != 0)
-		memcpy(ctx->buffer + have, input, len);
+        /* Handle any remaining bytes of data. */
+        if (len != 0)
+                memcpy (ctx->buffer + have, input, len);
 }
 
 /*
@@ -603,35 +626,35 @@
  * 1 0* (64-bit count of bits processed, MSB-first)
  */
 void
-MD5Pad(MD5_CTX *ctx)
+MD5Pad (MD5_CTX *ctx)
 {
-	u_int8_t count[8];
-	size_t padlen;
+        u_int8_t count[8];
+        size_t padlen;
 
-	/* Convert count to 8 bytes in little endian order. */
-	PUT_64BIT_LE(count, ctx->count);
+        /* Convert count to 8 bytes in little endian order. */
+        PUT_64BIT_LE (count, ctx->count);
 
-	/* Pad out to 56 mod 64. */
-	padlen = MD5_BLOCK_LENGTH -
-	    ((ctx->count >> 3) & (MD5_BLOCK_LENGTH - 1));
-	if (padlen < 1 + 8)
-		padlen += MD5_BLOCK_LENGTH;
-	MD5Update(ctx, PADDING, padlen - 8);		/* padlen - 8 <= 64 */
-	MD5Update(ctx, count, 8);
+        /* Pad out to 56 mod 64. */
+        padlen =
+          MD5_BLOCK_LENGTH - ((ctx->count >> 3) & (MD5_BLOCK_LENGTH - 1));
+        if (padlen < 1 + 8)
+                padlen += MD5_BLOCK_LENGTH;
+        MD5Update (ctx, PADDING, padlen - 8); /* padlen - 8 <= 64 */
+        MD5Update (ctx, count, 8);
 }
 
 /*
  * Final wrapup--call MD5Pad, fill in digest and zero out ctx.
  */
 void
-MD5Final(unsigned char digest[MD5_DIGEST_LENGTH], MD5_CTX *ctx)
+MD5Final (unsigned char digest[MD5_DIGEST_LENGTH], MD5_CTX *ctx)
 {
-	int i;
+        int i;
 
-	MD5Pad(ctx);
-	for (i = 0; i < 4; i++)
-		PUT_32BIT_LE(digest + i * 4, ctx->state[i]);
-	memset(ctx, 0, sizeof(*ctx));
+        MD5Pad (ctx);
+        for (i = 0; i < 4; i++)
+                PUT_32BIT_LE (digest + i * 4, ctx->state[i]);
+        memset (ctx, 0, sizeof (*ctx));
 }
 
 
@@ -639,13 +662,13 @@
 
 /* #define F1(x, y, z) (x & y | ~x & z) */
 #define F1(x, y, z) (z ^ (x & (y ^ z)))
-#define F2(x, y, z) F1(z, x, y)
+#define F2(x, y, z) F1 (z, x, y)
 #define F3(x, y, z) (x ^ y ^ z)
 #define F4(x, y, z) (y ^ (x | ~z))
 
 /* This is the central step in the MD5 algorithm. */
 #define MD5STEP(f, w, x, y, z, data, s) \
-	( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
+        (w += f (x, y, z) + data, w = w << s | w >> (32 - s), w += x)
 
 /*
  * The core of the MD5 algorithm, this alters an existing MD5 hash to
@@ -653,122 +676,123 @@
  * the data and converts bytes into longwords for this routine.
  */
 void
-MD5Transform(u_int32_t state[4], const u_int8_t block[MD5_BLOCK_LENGTH])
+MD5Transform (u_int32_t state[4], const u_int8_t block[MD5_BLOCK_LENGTH])
 {
-	u_int32_t a, b, c, d, in[MD5_BLOCK_LENGTH / 4];
+        u_int32_t a, b, c, d, in[MD5_BLOCK_LENGTH / 4];
 
 #if BYTE_ORDER == LITTLE_ENDIAN
-	memcpy(in, block, sizeof(in));
+        memcpy (in, block, sizeof (in));
 #else
-	for (a = 0; a < MD5_BLOCK_LENGTH / 4; a++) {
-		in[a] = (u_int32_t)(
-		    (u_int32_t)(block[a * 4 + 0]) |
-		    (u_int32_t)(block[a * 4 + 1]) <<  8 |
-		    (u_int32_t)(block[a * 4 + 2]) << 16 |
-		    (u_int32_t)(block[a * 4 + 3]) << 24);
-	}
+        for (a = 0; a < MD5_BLOCK_LENGTH / 4; a++)
+        {
+                in[a] = (u_int32_t) ((u_int32_t) (block[a * 4 + 0]) |
+                                     (u_int32_t) (block[a * 4 + 1]) << 8 |
+                                     (u_int32_t) (block[a * 4 + 2]) << 16 |
+                                     (u_int32_t) (block[a * 4 + 3]) << 24);
+        }
 #endif
 
-	a = state[0];
-	b = state[1];
-	c = state[2];
-	d = state[3];
+        a = state[0];
+        b = state[1];
+        c = state[2];
+        d = state[3];
 
-	MD5STEP(F1, a, b, c, d, in[ 0] + 0xd76aa478,  7);
-	MD5STEP(F1, d, a, b, c, in[ 1] + 0xe8c7b756, 12);
-	MD5STEP(F1, c, d, a, b, in[ 2] + 0x242070db, 17);
-	MD5STEP(F1, b, c, d, a, in[ 3] + 0xc1bdceee, 22);
-	MD5STEP(F1, a, b, c, d, in[ 4] + 0xf57c0faf,  7);
-	MD5STEP(F1, d, a, b, c, in[ 5] + 0x4787c62a, 12);
-	MD5STEP(F1, c, d, a, b, in[ 6] + 0xa8304613, 17);
-	MD5STEP(F1, b, c, d, a, in[ 7] + 0xfd469501, 22);
-	MD5STEP(F1, a, b, c, d, in[ 8] + 0x698098d8,  7);
-	MD5STEP(F1, d, a, b, c, in[ 9] + 0x8b44f7af, 12);
-	MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
-	MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
-	MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122,  7);
-	MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
-	MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
-	MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
+        MD5STEP (F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+        MD5STEP (F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+        MD5STEP (F1, c, d, a, b, in[2] + 0x242070db, 17);
+        MD5STEP (F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+        MD5STEP (F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+        MD5STEP (F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+        MD5STEP (F1, c, d, a, b, in[6] + 0xa8304613, 17);
+        MD5STEP (F1, b, c, d, a, in[7] + 0xfd469501, 22);
+        MD5STEP (F1, a, b, c, d, in[8] + 0x698098d8, 7);
+        MD5STEP (F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+        MD5STEP (F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+        MD5STEP (F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+        MD5STEP (F1, a, b, c, d, in[12] + 0x6b901122, 7);
+        MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12);
+        MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17);
+        MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22);
 
-	MD5STEP(F2, a, b, c, d, in[ 1] + 0xf61e2562,  5);
-	MD5STEP(F2, d, a, b, c, in[ 6] + 0xc040b340,  9);
-	MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
-	MD5STEP(F2, b, c, d, a, in[ 0] + 0xe9b6c7aa, 20);
-	MD5STEP(F2, a, b, c, d, in[ 5] + 0xd62f105d,  5);
-	MD5STEP(F2, d, a, b, c, in[10] + 0x02441453,  9);
-	MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
-	MD5STEP(F2, b, c, d, a, in[ 4] + 0xe7d3fbc8, 20);
-	MD5STEP(F2, a, b, c, d, in[ 9] + 0x21e1cde6,  5);
-	MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6,  9);
-	MD5STEP(F2, c, d, a, b, in[ 3] + 0xf4d50d87, 14);
-	MD5STEP(F2, b, c, d, a, in[ 8] + 0x455a14ed, 20);
-	MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905,  5);
-	MD5STEP(F2, d, a, b, c, in[ 2] + 0xfcefa3f8,  9);
-	MD5STEP(F2, c, d, a, b, in[ 7] + 0x676f02d9, 14);
-	MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+        MD5STEP (F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+        MD5STEP (F2, d, a, b, c, in[6] + 0xc040b340, 9);
+        MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+        MD5STEP (F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+        MD5STEP (F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+        MD5STEP (F2, d, a, b, c, in[10] + 0x02441453, 9);
+        MD5STEP (F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+        MD5STEP (F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+        MD5STEP (F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+        MD5STEP (F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+        MD5STEP (F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+        MD5STEP (F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+        MD5STEP (F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+        MD5STEP (F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+        MD5STEP (F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+        MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
 
-	MD5STEP(F3, a, b, c, d, in[ 5] + 0xfffa3942,  4);
-	MD5STEP(F3, d, a, b, c, in[ 8] + 0x8771f681, 11);
-	MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
-	MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
-	MD5STEP(F3, a, b, c, d, in[ 1] + 0xa4beea44,  4);
-	MD5STEP(F3, d, a, b, c, in[ 4] + 0x4bdecfa9, 11);
-	MD5STEP(F3, c, d, a, b, in[ 7] + 0xf6bb4b60, 16);
-	MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
-	MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6,  4);
-	MD5STEP(F3, d, a, b, c, in[ 0] + 0xeaa127fa, 11);
-	MD5STEP(F3, c, d, a, b, in[ 3] + 0xd4ef3085, 16);
-	MD5STEP(F3, b, c, d, a, in[ 6] + 0x04881d05, 23);
-	MD5STEP(F3, a, b, c, d, in[ 9] + 0xd9d4d039,  4);
-	MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
-	MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
-	MD5STEP(F3, b, c, d, a, in[2 ] + 0xc4ac5665, 23);
+        MD5STEP (F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+        MD5STEP (F3, d, a, b, c, in[8] + 0x8771f681, 11);
+        MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+        MD5STEP (F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+        MD5STEP (F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+        MD5STEP (F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+        MD5STEP (F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+        MD5STEP (F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+        MD5STEP (F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+        MD5STEP (F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+        MD5STEP (F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+        MD5STEP (F3, b, c, d, a, in[6] + 0x04881d05, 23);
+        MD5STEP (F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+        MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+        MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+        MD5STEP (F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
 
-	MD5STEP(F4, a, b, c, d, in[ 0] + 0xf4292244,  6);
-	MD5STEP(F4, d, a, b, c, in[7 ] + 0x432aff97, 10);
-	MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
-	MD5STEP(F4, b, c, d, a, in[5 ] + 0xfc93a039, 21);
-	MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3,  6);
-	MD5STEP(F4, d, a, b, c, in[3 ] + 0x8f0ccc92, 10);
-	MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
-	MD5STEP(F4, b, c, d, a, in[1 ] + 0x85845dd1, 21);
-	MD5STEP(F4, a, b, c, d, in[8 ] + 0x6fa87e4f,  6);
-	MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
-	MD5STEP(F4, c, d, a, b, in[6 ] + 0xa3014314, 15);
-	MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
-	MD5STEP(F4, a, b, c, d, in[4 ] + 0xf7537e82,  6);
-	MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
-	MD5STEP(F4, c, d, a, b, in[2 ] + 0x2ad7d2bb, 15);
-	MD5STEP(F4, b, c, d, a, in[9 ] + 0xeb86d391, 21);
+        MD5STEP (F4, a, b, c, d, in[0] + 0xf4292244, 6);
+        MD5STEP (F4, d, a, b, c, in[7] + 0x432aff97, 10);
+        MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+        MD5STEP (F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+        MD5STEP (F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+        MD5STEP (F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+        MD5STEP (F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+        MD5STEP (F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+        MD5STEP (F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+        MD5STEP (F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+        MD5STEP (F4, c, d, a, b, in[6] + 0xa3014314, 15);
+        MD5STEP (F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+        MD5STEP (F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+        MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+        MD5STEP (F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+        MD5STEP (F4, b, c, d, a, in[9] + 0xeb86d391, 21);
 
-	state[0] += a;
-	state[1] += b;
-	state[2] += c;
-	state[3] += d;
+        state[0] += a;
+        state[1] += b;
+        state[2] += c;
+        state[3] += d;
 }
 
 char *
-MD5End(MD5_CTX *ctx, char *buf)
+MD5End (MD5_CTX *ctx, char *buf)
 {
-	int i;
-	unsigned char digest[MD5_DIGEST_LENGTH];
-	static const char hex[]="0123456789abcdef";
+        int i;
+        unsigned char digest[MD5_DIGEST_LENGTH];
+        static const char hex[] = "0123456789abcdef";
 
-	if (!buf)
-		buf = malloc(2*MD5_DIGEST_LENGTH + 1);
-	if (!buf)
-		return 0;
-	MD5Final(digest, ctx);
-	for (i = 0; i < MD5_DIGEST_LENGTH; i++) {
-		buf[i+i] = hex[digest[i] >> 4];
-		buf[i+i+1] = hex[digest[i] & 0x0f];
-	}
-	buf[i+i] = '\0';
-	return buf;
+        if (! buf)
+                buf = malloc (2 * MD5_DIGEST_LENGTH + 1);
+        if (! buf)
+                return 0;
+        MD5Final (digest, ctx);
+        for (i = 0; i < MD5_DIGEST_LENGTH; i++)
+        {
+                buf[i + i] = hex[digest[i] >> 4];
+                buf[i + i + 1] = hex[digest[i] & 0x0f];
+        }
+        buf[i + i] = '\0';
+        return buf;
 }
 #endif /* !HAVE_MD5 */
-#if !HAVE_MEMMEM
+#if ! HAVE_MEMMEM
 /*-
  * Copyright (c) 2005 Pascal Gloor <pascal.gloor@spale.com>
  *
@@ -801,35 +825,35 @@
  * Find the first occurrence of the byte string s in byte string l.
  */
 void *
-memmem(const void *l, size_t l_len, const void *s, size_t s_len)
+memmem (const void *l, size_t l_len, const void *s, size_t s_len)
 {
-	const char *cur, *last;
-	const char *cl = l;
-	const char *cs = s;
+        const char *cur, *last;
+        const char *cl = l;
+        const char *cs = s;
 
-	/* a zero length needle should just return the haystack */
-	if (l_len == 0)
-		return (void *)cl;
+        /* a zero length needle should just return the haystack */
+        if (l_len == 0)
+                return (void *) cl;
 
-	/* "s" must be smaller or equal to "l" */
-	if (l_len < s_len)
-		return NULL;
+        /* "s" must be smaller or equal to "l" */
+        if (l_len < s_len)
+                return NULL;
 
-	/* special case where s_len == 1 */
-	if (s_len == 1)
-		return memchr(l, *cs, l_len);
+        /* special case where s_len == 1 */
+        if (s_len == 1)
+                return memchr (l, *cs, l_len);
 
-	/* the last position where its possible to find "s" in "l" */
-	last = cl + l_len - s_len;
+        /* the last position where its possible to find "s" in "l" */
+        last = cl + l_len - s_len;
 
-	for (cur = cl; cur <= last; cur++)
-		if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
-			return (void *)cur;
+        for (cur = cl; cur <= last; cur++)
+                if (cur[0] == cs[0] && memcmp (cur, cs, s_len) == 0)
+                        return (void *) cur;
 
-	return NULL;
+        return NULL;
 }
 #endif /* !HAVE_MEMMEM */
-#if !HAVE_MEMRCHR
+#if ! HAVE_MEMRCHR
 /*
  * Copyright (c) 2007 Todd C. Miller <Todd.Miller@courtesan.com>
  *
@@ -854,21 +878,23 @@
  * Find the last occurrence of 'c' in the buffer 's' of size 'n'.
  */
 void *
-memrchr(const void *s, int c, size_t n)
+memrchr (const void *s, int c, size_t n)
 {
-    const unsigned char *cp;
+        const unsigned char *cp;
 
-    if (n != 0) {
-        cp = (unsigned char *)s + n;
-        do {
-            if (*(--cp) == (unsigned char)c)
-                return((void *)cp);
-        } while (--n != 0);
-    }
-    return(NULL);
+        if (n != 0)
+        {
+                cp = (unsigned char *) s + n;
+                do
+                {
+                        if (*(--cp) == (unsigned char) c)
+                                return ((void *) cp);
+                } while (--n != 0);
+        }
+        return (NULL);
 }
 #endif /* !HAVE_MEMRCHR */
-#if !HAVE_REALLOCARRAY
+#if ! HAVE_REALLOCARRAY
 /*
  * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
  *
@@ -894,20 +920,21 @@
  * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
  * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
  */
-#define MUL_NO_OVERFLOW	((size_t)1 << (sizeof(size_t) * 4))
+#define MUL_NO_OVERFLOW ((size_t) 1 << (sizeof (size_t) * 4))
 
 void *
-reallocarray(void *optr, size_t nmemb, size_t size)
+reallocarray (void *optr, size_t nmemb, size_t size)
 {
-	if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
-	    nmemb > 0 && SIZE_MAX / nmemb < size) {
-		errno = ENOMEM;
-		return NULL;
-	}
-	return realloc(optr, size * nmemb);
+        if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
+            nmemb > 0 && SIZE_MAX / nmemb < size)
+        {
+                errno = ENOMEM;
+                return NULL;
+        }
+        return realloc (optr, size * nmemb);
 }
 #endif /* !HAVE_REALLOCARRAY */
-#if !HAVE_RECALLOCARRAY
+#if ! HAVE_RECALLOCARRAY
 /*
  * Copyright (c) 2008, 2017 Otto Moerbeek <otto@drijf.net>
  *
@@ -936,61 +963,67 @@
  * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
  * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
  */
-#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
+#define MUL_NO_OVERFLOW ((size_t) 1 << (sizeof (size_t) * 4))
 
 void *
-recallocarray(void *ptr, size_t oldnmemb, size_t newnmemb, size_t size)
+recallocarray (void *ptr, size_t oldnmemb, size_t newnmemb, size_t size)
 {
-	size_t oldsize, newsize;
-	void *newptr;
+        size_t oldsize, newsize;
+        void *newptr;
+
+        if (ptr == NULL)
+                return calloc (newnmemb, size);
 
-	if (ptr == NULL)
-		return calloc(newnmemb, size);
+        if ((newnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
+            newnmemb > 0 && SIZE_MAX / newnmemb < size)
+        {
+                errno = ENOMEM;
+                return NULL;
+        }
+        newsize = newnmemb * size;
 
-	if ((newnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
-	    newnmemb > 0 && SIZE_MAX / newnmemb < size) {
-		errno = ENOMEM;
-		return NULL;
-	}
-	newsize = newnmemb * size;
+        if ((oldnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
+            oldnmemb > 0 && SIZE_MAX / oldnmemb < size)
+        {
+                errno = EINVAL;
+                return NULL;
+        }
+        oldsize = oldnmemb * size;
 
-	if ((oldnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
-	    oldnmemb > 0 && SIZE_MAX / oldnmemb < size) {
-		errno = EINVAL;
-		return NULL;
-	}
-	oldsize = oldnmemb * size;
-	
-	/*
-	 * Don't bother too much if we're shrinking just a bit,
-	 * we do not shrink for series of small steps, oh well.
-	 */
-	if (newsize <= oldsize) {
-		size_t d = oldsize - newsize;
+        /*
+         * Don't bother too much if we're shrinking just a bit,
+         * we do not shrink for series of small steps, oh well.
+         */
+        if (newsize <= oldsize)
+        {
+                size_t d = oldsize - newsize;
+
+                if (d < oldsize / 2 && d < (size_t) getpagesize ())
+                {
+                        memset ((char *) ptr + newsize, 0, d);
+                        return ptr;
+                }
+        }
 
-		if (d < oldsize / 2 && d < (size_t)getpagesize()) {
-			memset((char *)ptr + newsize, 0, d);
-			return ptr;
-		}
-	}
-
-	newptr = malloc(newsize);
-	if (newptr == NULL)
-		return NULL;
+        newptr = malloc (newsize);
+        if (newptr == NULL)
+                return NULL;
 
-	if (newsize > oldsize) {
-		memcpy(newptr, ptr, oldsize);
-		memset((char *)newptr + oldsize, 0, newsize - oldsize);
-	} else
-		memcpy(newptr, ptr, newsize);
+        if (newsize > oldsize)
+        {
+                memcpy (newptr, ptr, oldsize);
+                memset ((char *) newptr + oldsize, 0, newsize - oldsize);
+        }
+        else
+                memcpy (newptr, ptr, newsize);
 
-	explicit_bzero(ptr, oldsize);
-	free(ptr);
+        explicit_bzero (ptr, oldsize);
+        free (ptr);
 
-	return newptr;
+        return newptr;
 }
 #endif /* !HAVE_RECALLOCARRAY */
-#if !HAVE_STRLCAT
+#if ! HAVE_STRLCAT
 /*
  * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
  *
@@ -1018,34 +1051,36 @@
  * If retval >= siz, truncation occurred.
  */
 size_t
-strlcat(char *dst, const char *src, size_t siz)
+strlcat (char *dst, const char *src, size_t siz)
 {
-	char *d = dst;
-	const char *s = src;
-	size_t n = siz;
-	size_t dlen;
+        char *d = dst;
+        const char *s = src;
+        size_t n = siz;
+        size_t dlen;
 
-	/* Find the end of dst and adjust bytes left but don't go past end */
-	while (n-- != 0 && *d != '\0')
-		d++;
-	dlen = d - dst;
-	n = siz - dlen;
+        /* Find the end of dst and adjust bytes left but don't go past end */
+        while (n-- != 0 && *d != '\0')
+                d++;
+        dlen = d - dst;
+        n = siz - dlen;
 
-	if (n == 0)
-		return(dlen + strlen(s));
-	while (*s != '\0') {
-		if (n != 1) {
-			*d++ = *s;
-			n--;
-		}
-		s++;
-	}
-	*d = '\0';
+        if (n == 0)
+                return (dlen + strlen (s));
+        while (*s != '\0')
+        {
+                if (n != 1)
+                {
+                        *d++ = *s;
+                        n--;
+                }
+                s++;
+        }
+        *d = '\0';
 
-	return(dlen + (s - src));	/* count does not include NUL */
+        return (dlen + (s - src)); /* count does not include NUL */
 }
 #endif /* !HAVE_STRLCAT */
-#if !HAVE_STRLCPY
+#if ! HAVE_STRLCPY
 /*
  * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
  *
@@ -1071,32 +1106,35 @@
  * Returns strlen(src); if retval >= siz, truncation occurred.
  */
 size_t
-strlcpy(char *dst, const char *src, size_t siz)
+strlcpy (char *dst, const char *src, size_t siz)
 {
-	char *d = dst;
-	const char *s = src;
-	size_t n = siz;
+        char *d = dst;
+        const char *s = src;
+        size_t n = siz;
 
-	/* Copy as many bytes as will fit */
-	if (n != 0) {
-		while (--n != 0) {
-			if ((*d++ = *s++) == '\0')
-				break;
-		}
-	}
+        /* Copy as many bytes as will fit */
+        if (n != 0)
+        {
+                while (--n != 0)
+                {
+                        if ((*d++ = *s++) == '\0')
+                                break;
+                }
+        }
 
-	/* Not enough room in dst, add NUL and traverse rest of src */
-	if (n == 0) {
-		if (siz != 0)
-			*d = '\0';		/* NUL-terminate dst */
-		while (*s++)
-			;
-	}
+        /* Not enough room in dst, add NUL and traverse rest of src */
+        if (n == 0)
+        {
+                if (siz != 0)
+                        *d = '\0'; /* NUL-terminate dst */
+                while (*s++)
+                        ;
+        }
 
-	return(s - src - 1);	/* count does not include NUL */
+        return (s - src - 1); /* count does not include NUL */
 }
 #endif /* !HAVE_STRLCPY */
-#if !HAVE_STRNDUP
+#if ! HAVE_STRNDUP
 /*	$OpenBSD$	*/
 /*
  * Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -1121,22 +1159,23 @@
 #include <string.h>
 
 char *
-strndup(const char *str, size_t maxlen)
+strndup (const char *str, size_t maxlen)
 {
-	char *copy;
-	size_t len;
+        char *copy;
+        size_t len;
 
-	len = strnlen(str, maxlen);
-	copy = malloc(len + 1);
-	if (copy != NULL) {
-		(void)memcpy(copy, str, len);
-		copy[len] = '\0';
-	}
+        len = strnlen (str, maxlen);
+        copy = malloc (len + 1);
+        if (copy != NULL)
+        {
+                (void) memcpy (copy, str, len);
+                copy[len] = '\0';
+        }
 
-	return copy;
+        return copy;
 }
 #endif /* !HAVE_STRNDUP */
-#if !HAVE_STRNLEN
+#if ! HAVE_STRNLEN
 /*	$OpenBSD$	*/
 
 /*
@@ -1159,17 +1198,17 @@
 #include <string.h>
 
 size_t
-strnlen(const char *str, size_t maxlen)
+strnlen (const char *str, size_t maxlen)
 {
-	const char *cp;
+        const char *cp;
 
-	for (cp = str; maxlen != 0 && *cp != '\0'; cp++, maxlen--)
-		;
+        for (cp = str; maxlen != 0 && *cp != '\0'; cp++, maxlen--)
+                ;
 
-	return (size_t)(cp - str);
+        return (size_t) (cp - str);
 }
 #endif /* !HAVE_STRNLEN */
-#if !HAVE_STRTONUM
+#if ! HAVE_STRTONUM
 /*
  * Copyright (c) 2004 Ted Unangst and Todd Miller
  * All rights reserved.
@@ -1191,46 +1230,52 @@
 #include <limits.h>
 #include <stdlib.h>
 
-#define	INVALID		1
-#define	TOOSMALL	2
-#define	TOOLARGE	3
+#define INVALID 1
+#define TOOSMALL 2
+#define TOOLARGE 3
 
 long long
-strtonum(const char *numstr, long long minval, long long maxval,
-    const char **errstrp)
+strtonum (const char *numstr,
+          long long minval,
+          long long maxval,
+          const char **errstrp)
 {
-	long long ll = 0;
-	int error = 0;
-	char *ep;
-	struct errval {
-		const char *errstr;
-		int err;
-	} ev[4] = {
-		{ NULL,		0 },
-		{ "invalid",	EINVAL },
-		{ "too small",	ERANGE },
-		{ "too large",	ERANGE },
-	};
+        long long ll = 0;
+        int error = 0;
+        char *ep;
+        struct errval
+        {
+                const char *errstr;
+                int err;
+        } ev[4] = {
+          {NULL, 0},
+          {"invalid", EINVAL},
+          {"too small", ERANGE},
+          {"too large", ERANGE},
+        };
 
-	ev[0].err = errno;
-	errno = 0;
-	if (minval > maxval) {
-		error = INVALID;
-	} else {
-		ll = strtoll(numstr, &ep, 10);
-		if (numstr == ep || *ep != '\0')
-			error = INVALID;
-		else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval)
-			error = TOOSMALL;
-		else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval)
-			error = TOOLARGE;
-	}
-	if (errstrp != NULL)
-		*errstrp = ev[error].errstr;
-	errno = ev[error].err;
-	if (error)
-		ll = 0;
+        ev[0].err = errno;
+        errno = 0;
+        if (minval > maxval)
+        {
+                error = INVALID;
+        }
+        else
+        {
+                ll = strtoll (numstr, &ep, 10);
+                if (numstr == ep || *ep != '\0')
+                        error = INVALID;
+                else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval)
+                        error = TOOSMALL;
+                else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval)
+                        error = TOOLARGE;
+        }
+        if (errstrp != NULL)
+                *errstrp = ev[error].errstr;
+        errno = ev[error].err;
+        if (error)
+                ll = 0;
 
-	return (ll);
+        return (ll);
 }
 #endif /* !HAVE_STRTONUM */
--- a/cvs_direct.c	Fri Oct 25 10:45:36 2019 +0000
+++ b/cvs_direct.c	Fri Oct 25 10:58:18 2019 +0000
@@ -410,7 +410,7 @@
 void
 close_cvs_server (CvsServerCtx *ctx)
 {
-        /* 
+        /*
          * FIXME: some sort of flushing should be done for non-compressed case
          */
 
--- a/cvsps.c	Fri Oct 25 10:45:36 2019 +0000
+++ b/cvsps.c	Fri Oct 25 10:58:18 2019 +0000
@@ -1094,7 +1094,7 @@
                 }
         }
 
-        /* 
+        /*
          * Determine the repository path, precedence:
          * 1) command line
          * 2) working directory
@@ -1124,7 +1124,7 @@
         else
                 p++;
 
-        /* 
+        /*
          * some CVS have the CVSROOT string as part of the repository
          * string (initial substring).  remove it.
          */
@@ -1136,7 +1136,7 @@
                 memmove (repository_path, repository_path + len + 1, rlen + 1);
         }
 
-        /* 
+        /*
          * the 'strip_path' will be used whenever the CVS server gives us a
          * path to an 'rcs file'.  the strip_path portion of these paths is
          * stripped off, leaving us with the working file.
@@ -1176,7 +1176,7 @@
 
         if (strncmp (fn, strip_path, strip_path_len) != 0)
         {
-                /* 
+                /*
                  * if the very first file fails the strip path,
                  * then maybe we need to try for an alternate.
                  * this will happen if symlinks are being used
--- a/cvsps.h	Fri Oct 25 10:45:36 2019 +0000
+++ b/cvsps.h	Fri Oct 25 10:58:18 2019 +0000
@@ -21,18 +21,27 @@
 extern char root_path[];
 extern char repository_path[];
 
-CvsFile * create_cvsfile (void);
-CvsFileRevision * cvs_file_add_revision (CvsFile *, const char *);
-void cvs_file_add_symbol (CvsFile *file, const char *rev, const char *tag);
-char * cvs_file_add_branch (CvsFile *, const char *, const char *);
-PatchSet * get_patch_set (const char *,
-			  const char *,
-			  const char *,
-			  const char *,
-			  PatchSetMember *);
-PatchSetMember * create_patch_set_member (void);
-CvsFileRevision * file_get_revision (CvsFile *, const char *);
-void patch_set_add_member (PatchSet *ps, PatchSetMember *psm);
-void walk_all_patch_sets (void (*action) (PatchSet *));
+CvsFile *
+create_cvsfile (void);
+CvsFileRevision *
+cvs_file_add_revision (CvsFile *, const char *);
+void
+cvs_file_add_symbol (CvsFile *file, const char *rev, const char *tag);
+char *
+cvs_file_add_branch (CvsFile *, const char *, const char *);
+PatchSet *
+get_patch_set (const char *,
+               const char *,
+               const char *,
+               const char *,
+               PatchSetMember *);
+PatchSetMember *
+create_patch_set_member (void);
+CvsFileRevision *
+file_get_revision (CvsFile *, const char *);
+void
+patch_set_add_member (PatchSet *ps, PatchSetMember *psm);
+void
+walk_all_patch_sets (void (*action) (PatchSet *));
 
 #endif /* CVSPS_H */
--- a/tests.c	Fri Oct 25 10:45:36 2019 +0000
+++ b/tests.c	Fri Oct 25 10:58:18 2019 +0000
@@ -1,19 +1,19 @@
 #if TEST___PROGNAME
 int
-main(void)
+main (void)
 {
-	extern char *__progname;
+        extern char *__progname;
 
-	return !__progname;
+        return ! __progname;
 }
 #endif /* TEST___PROGNAME */
 #if TEST_ARC4RANDOM
 #include <stdlib.h>
 
 int
-main(void)
+main (void)
 {
-	return (arc4random() + 1) ? 0 : 1;
+        return (arc4random () + 1) ? 0 : 1;
 }
 #endif /* TEST_ARC4RANDOM */
 #if TEST_B64_NTOP
@@ -21,22 +21,27 @@
 #include <resolv.h>
 
 int
-main(void)
+main (void)
 {
-	const char *src = "hello world";
-	char output[1024];
+        const char *src = "hello world";
+        char output[1024];
 
-	return b64_ntop((const unsigned char *)src, 11, output, sizeof(output)) > 0 ? 0 : 1;
+        return b64_ntop ((const unsigned char *) src,
+                         11,
+                         output,
+                         sizeof (output)) > 0
+                 ? 0
+                 : 1;
 }
 #endif /* TEST_B64_NTOP */
 #if TEST_CAPSICUM
 #include <sys/capsicum.h>
 
 int
-main(void)
+main (void)
 {
-	cap_enter();
-	return(0);
+        cap_enter ();
+        return (0);
 }
 #endif /* TEST_CAPSICUM */
 #if TEST_ERR
@@ -59,37 +64,37 @@
 #include <err.h>
 
 int
-main(void)
+main (void)
 {
-	warnx("%d. warnx", 1);
-	warn("%d. warn", 2);
-	err(0, "%d. err", 3);
-	/* NOTREACHED */
-	return 1;
+        warnx ("%d. warnx", 1);
+        warn ("%d. warn", 2);
+        err (0, "%d. err", 3);
+        /* NOTREACHED */
+        return 1;
 }
 #endif /* TEST_ERR */
 #if TEST_EXPLICIT_BZERO
 #include <string.h>
 
 int
-main(void)
+main (void)
 {
-	char foo[10];
+        char foo[10];
 
-	explicit_bzero(foo, sizeof(foo));
-	return(0);
+        explicit_bzero (foo, sizeof (foo));
+        return (0);
 }
 #endif /* TEST_EXPLICIT_BZERO */
 #if TEST_GETPROGNAME
 #include <stdlib.h>
 
 int
-main(void)
+main (void)
 {
-	const char * progname;
+        const char *progname;
 
-	progname = getprogname();
-	return progname == NULL;
+        progname = getprogname ();
+        return progname == NULL;
 }
 #endif /* TEST_GETPROGNAME */
 #if TEST_INFTIM
@@ -101,24 +106,25 @@
 #include <stdio.h>
 
 int
-main(void)
+main (void)
 {
-	printf("INFTIM is defined to be %ld\n", (long)INFTIM);
-	return 0;
+        printf ("INFTIM is defined to be %ld\n", (long) INFTIM);
+        return 0;
 }
 #endif /* TEST_INFTIM */
 #if TEST_MD5
 #include <sys/types.h>
 #include <md5.h>
 
-int main(void)
+int
+main (void)
 {
-	MD5_CTX ctx;
+        MD5_CTX ctx;
 
-	MD5Init(&ctx);
-	MD5Update(&ctx, "abcd", 4);
+        MD5Init (&ctx);
+        MD5Update (&ctx, "abcd", 4);
 
-	return 0;
+        return 0;
 }
 #endif /* TEST_MD5 */
 #if TEST_MEMMEM
@@ -126,36 +132,40 @@
 #include <string.h>
 
 int
-main(void)
+main (void)
 {
-	char *a = memmem("hello, world", strlen("hello, world"), "world", strlen("world"));
-	return(NULL == a);
+        char *a = memmem ("hello, world",
+                          strlen ("hello, world"),
+                          "world",
+                          strlen ("world"));
+        return (NULL == a);
 }
 #endif /* TEST_MEMMEM */
 #if TEST_MEMRCHR
 #if defined(__linux__) || defined(__MINT__)
-#define _GNU_SOURCE	/* See test-*.c what needs this. */
+#define _GNU_SOURCE /* See test-*.c what needs this. */
 #endif
 #include <string.h>
 
 int
-main(void)
+main (void)
 {
-	const char *buf = "abcdef";
-	void *res;
+        const char *buf = "abcdef";
+        void *res;
 
-	res = memrchr(buf, 'a', strlen(buf));
-	return(NULL == res ? 1 : 0);
+        res = memrchr (buf, 'a', strlen (buf));
+        return (NULL == res ? 1 : 0);
 }
 #endif /* TEST_MEMRCHR */
 #if TEST_MEMSET_S
 #include <string.h>
 
-int main(void)
+int
+main (void)
 {
-	char buf[10];
-	memset_s(buf, 0, 'c', sizeof(buf));
-	return 0;
+        char buf[10];
+        memset_s (buf, 0, 'c', sizeof (buf));
+        return 0;
 }
 #endif /* TEST_MEMSET_S */
 #if TEST_PATH_MAX
@@ -184,63 +194,63 @@
 #include <stdio.h>
 
 int
-main(void)
+main (void)
 {
-	printf("PATH_MAX is defined to be %ld\n", (long)PATH_MAX);
-	return 0;
+        printf ("PATH_MAX is defined to be %ld\n", (long) PATH_MAX);
+        return 0;
 }
 #endif /* TEST_PATH_MAX */
 #if TEST_PLEDGE
 #include <unistd.h>
 
 int
-main(void)
+main (void)
 {
-	return !!pledge("stdio", NULL);
+        return ! ! pledge ("stdio", NULL);
 }
 #endif /* TEST_PLEDGE */
 #if TEST_PROGRAM_INVOCATION_SHORT_NAME
-#define _GNU_SOURCE         /* See feature_test_macros(7) */
+#define _GNU_SOURCE /* See feature_test_macros(7) */
 #include <errno.h>
 
 int
-main(void)
+main (void)
 {
 
-	return !program_invocation_short_name;
+        return ! program_invocation_short_name;
 }
 #endif /* TEST_PROGRAM_INVOCATION_SHORT_NAME */
 #if TEST_REALLOCARRAY
 #include <stdlib.h>
 
 int
-main(void)
+main (void)
 {
-	return !reallocarray(NULL, 2, 2);
+        return ! reallocarray (NULL, 2, 2);
 }
 #endif /* TEST_REALLOCARRAY */
 #if TEST_RECALLOCARRAY
 #include <stdlib.h>
 
 int
-main(void)
+main (void)
 {
-	return !recallocarray(NULL, 0, 2, 2);
+        return ! recallocarray (NULL, 0, 2, 2);
 }
 #endif /* TEST_RECALLOCARRAY */
 #if TEST_SANDBOX_INIT
 #include <sandbox.h>
 
 int
-main(void)
+main (void)
 {
-	char	*ep;
-	int	 rc;
+        char *ep;
+        int rc;
 
-	rc = sandbox_init(kSBXProfileNoInternet, SANDBOX_NAMED, &ep);
-	if (-1 == rc)
-		sandbox_free_error(ep);
-	return(-1 == rc);
+        rc = sandbox_init (kSBXProfileNoInternet, SANDBOX_NAMED, &ep);
+        if (-1 == rc)
+                sandbox_free_error (ep);
+        return (-1 == rc);
 }
 #endif /* TEST_SANDBOX_INIT */
 #if TEST_SECCOMP_FILTER
@@ -249,11 +259,11 @@
 #include <errno.h>
 
 int
-main(void)
+main (void)
 {
 
-	prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0);
-	return(EFAULT == errno ? 0 : 1);
+        prctl (PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0);
+        return (EFAULT == errno ? 0 : 1);
 }
 #endif /* TEST_SECCOMP_FILTER */
 #if TEST_SOCK_NONBLOCK
@@ -264,59 +274,59 @@
 #include <sys/socket.h>
 
 int
-main(void)
+main (void)
 {
-	int fd[2];
-	socketpair(AF_UNIX, SOCK_STREAM|SOCK_NONBLOCK, 0, fd);
-	return 0;
+        int fd[2];
+        socketpair (AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0, fd);
+        return 0;
 }
 #endif /* TEST_SOCK_NONBLOCK */
 #if TEST_STRLCAT
 #include <string.h>
 
 int
-main(void)
+main (void)
 {
-	char buf[3] = "a";
-	return ! (strlcat(buf, "b", sizeof(buf)) == 2 &&
-	    buf[0] == 'a' && buf[1] == 'b' && buf[2] == '\0');
+        char buf[3] = "a";
+        return ! (strlcat (buf, "b", sizeof (buf)) == 2 && buf[0] == 'a' &&
+                  buf[1] == 'b' && buf[2] == '\0');
 }
 #endif /* TEST_STRLCAT */
 #if TEST_STRLCPY
 #include <string.h>
 
 int
-main(void)
+main (void)
 {
-	char buf[2] = "";
-	return ! (strlcpy(buf, "a", sizeof(buf)) == 1 &&
-	    buf[0] == 'a' && buf[1] == '\0');
+        char buf[2] = "";
+        return ! (strlcpy (buf, "a", sizeof (buf)) == 1 && buf[0] == 'a' &&
+                  buf[1] == '\0');
 }
 #endif /* TEST_STRLCPY */
 #if TEST_STRNDUP
 #include <string.h>
 
 int
-main(void)
+main (void)
 {
-	const char *foo = "bar";
-	char *baz;
+        const char *foo = "bar";
+        char *baz;
 
-	baz = strndup(foo, 1);
-	return(0 != strcmp(baz, "b"));
+        baz = strndup (foo, 1);
+        return (0 != strcmp (baz, "b"));
 }
 #endif /* TEST_STRNDUP */
 #if TEST_STRNLEN
 #include <string.h>
 
 int
-main(void)
+main (void)
 {
-	const char *foo = "bar";
-	size_t sz;
+        const char *foo = "bar";
+        size_t sz;
 
-	sz = strnlen(foo, 1);
-	return(1 != sz);
+        sz = strnlen (foo, 1);
+        return (1 != sz);
 }
 #endif /* TEST_STRNLEN */
 #if TEST_STRTONUM
@@ -339,47 +349,48 @@
 #include <stdlib.h>
 
 int
-main(void)
+main (void)
 {
-	const char *errstr;
+        const char *errstr;
 
-	if (strtonum("1", 0, 2, &errstr) != 1)
-		return 1;
-	if (errstr != NULL)
-		return 2;
-	if (strtonum("1x", 0, 2, &errstr) != 0)
-		return 3;
-	if (errstr == NULL)
-		return 4;
-	if (strtonum("2", 0, 1, &errstr) != 0)
-		return 5;
-	if (errstr == NULL)
-		return 6;
-	if (strtonum("0", 1, 2, &errstr) != 0)
-		return 7;
-	if (errstr == NULL)
-		return 8;
-	return 0;
+        if (strtonum ("1", 0, 2, &errstr) != 1)
+                return 1;
+        if (errstr != NULL)
+                return 2;
+        if (strtonum ("1x", 0, 2, &errstr) != 0)
+                return 3;
+        if (errstr == NULL)
+                return 4;
+        if (strtonum ("2", 0, 1, &errstr) != 0)
+                return 5;
+        if (errstr == NULL)
+                return 6;
+        if (strtonum ("0", 1, 2, &errstr) != 0)
+                return 7;
+        if (errstr == NULL)
+                return 8;
+        return 0;
 }
 #endif /* TEST_STRTONUM */
 #if TEST_SYS_QUEUE
 #include <sys/queue.h>
 #include <stddef.h>
 
-struct foo {
-	int bar;
-	TAILQ_ENTRY(foo) entries;
+struct foo
+{
+        int bar;
+        TAILQ_ENTRY (foo) entries;
 };
 
-TAILQ_HEAD(fooq, foo);
+TAILQ_HEAD (fooq, foo);
 
 int
-main(void)
+main (void)
 {
-	struct fooq foo_q;
+        struct fooq foo_q;
 
-	TAILQ_INIT(&foo_q);
-	return 0;
+        TAILQ_INIT (&foo_q);
+        return 0;
 }
 #endif /* TEST_SYS_QUEUE */
 #if TEST_SYSTRACE
@@ -389,10 +400,10 @@
 #include <stdlib.h>
 
 int
-main(void)
+main (void)
 {
 
-	return(0);
+        return (0);
 }
 #endif /* TEST_SYSTRACE */
 #if TEST_ZLIB
@@ -400,14 +411,14 @@
 #include <zlib.h>
 
 int
-main(void)
+main (void)
 {
-	gzFile		 gz;
+        gzFile gz;
 
-	if (NULL == (gz = gzopen("/dev/null", "w")))
-		return(1);
-	gzputs(gz, "foo");
-	gzclose(gz);
-	return(0);
+        if (NULL == (gz = gzopen ("/dev/null", "w")))
+                return (1);
+        gzputs (gz, "foo");
+        gzclose (gz);
+        return (0);
 }
 #endif /* TEST_ZLIB */
--- a/util.h	Fri Oct 25 10:45:36 2019 +0000
+++ b/util.h	Fri Oct 25 10:58:18 2019 +0000
@@ -12,17 +12,29 @@
 #define PATH_MAX 4096
 #endif
 
-char * xstrdup (char const *);
-void strzncpy (char *dst, const char *src, int n);
-char * readfile (char const *filename, char *buf, size_t size);
-char * strrep (char *s, char find, char replace);
-char * get_cvsps_dir (void);
-char * get_string (char const *str);
-void convert_date (time_t *, const char *);
-void timing_start (void);
-void timing_stop (const char *);
-int my_system (const char *);
-int escape_filename (char *, int, const char *);
-void strcpy_a (char *dst, const char *src, int n);
+char *
+xstrdup (char const *);
+void
+strzncpy (char *dst, const char *src, int n);
+char *
+readfile (char const *filename, char *buf, size_t size);
+char *
+strrep (char *s, char find, char replace);
+char *
+get_cvsps_dir (void);
+char *
+get_string (char const *str);
+void
+convert_date (time_t *, const char *);
+void
+timing_start (void);
+void
+timing_stop (const char *);
+int
+my_system (const char *);
+int
+escape_filename (char *, int, const char *);
+void
+strcpy_a (char *dst, const char *src, int n);
 
 #endif /* UTIL_H */