summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-04-29 02:43:07 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-04-29 02:43:07 +0000
commit9026dba29fa7ed57578a41efb4e48f5f5e740f94 (patch)
tree7debf507a15ea3a0a7d1e840018d6e026403f90b /lib/libc
parent6d616545ae56cb762cff38b7262258a1fda04732 (diff)
more KNF
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/hash/helper.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/libc/hash/helper.c b/lib/libc/hash/helper.c
index 5a64c3c84fd..8c686e30150 100644
--- a/lib/libc/hash/helper.c
+++ b/lib/libc/hash/helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: helper.c,v 1.2 2004/04/29 02:39:32 millert Exp $ */
+/* $OpenBSD: helper.c,v 1.3 2004/04/29 02:43:06 millert Exp $ */
/*
* ----------------------------------------------------------------------------
@@ -10,7 +10,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$OpenBSD: helper.c,v 1.2 2004/04/29 02:39:32 millert Exp $";
+static const char rcsid[] = "$OpenBSD: helper.c,v 1.3 2004/04/29 02:43:06 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -35,7 +35,7 @@ HASHEnd(HASH_CTX *ctx, char buf[HASH_DIGEST_STRING_LENGTH])
if (buf == NULL && (buf = malloc(HASH_DIGEST_STRING_LENGTH)) == NULL)
return(NULL);
- HASHFinal(digest,ctx);
+ HASHFinal(digest, ctx);
for (i = 0; i < HASH_DIGEST_LENGTH; i++) {
buf[i + i] = hex[digest[i] >> 4];
buf[i + i + 1] = hex[digest[i] & 0x0f];
@@ -48,22 +48,22 @@ HASHEnd(HASH_CTX *ctx, char buf[HASH_DIGEST_STRING_LENGTH])
char *
HASHFile(char *filename, char buf[HASH_DIGEST_STRING_LENGTH])
{
- u_char buffer[BUFSIZ];
- HASH_CTX ctx;
- int fd, num, save_errno;
+ u_char buffer[BUFSIZ];
+ HASH_CTX ctx;
+ int fd, num, save_errno;
- HASHInit(&ctx);
+ HASHInit(&ctx);
- if ((fd = open(filename, O_RDONLY)) < 0)
- return(NULL);
+ if ((fd = open(filename, O_RDONLY)) < 0)
+ return(NULL);
- while ((num = read(fd, buffer, sizeof(buffer))) > 0)
- HASHUpdate(&ctx, buffer, num);
+ while ((num = read(fd, buffer, sizeof(buffer))) > 0)
+ HASHUpdate(&ctx, buffer, num);
- save_errno = errno;
- close(fd);
- errno = save_errno;
- return (num < 0 ? NULL : HASHEnd(&ctx, buf));
+ save_errno = errno;
+ close(fd);
+ errno = save_errno;
+ return (num < 0 ? NULL : HASHEnd(&ctx, buf));
}
char *