summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2021-10-22 09:49:27 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2021-10-22 09:49:27 +0000
commit6935345c2c93a4e1e0642348678beeffbb887bbf (patch)
tree549b5c3201c47da85058a0681b6d04366a3f0bf8
parent53035b88895fe374215ab665d18f94aa61584312 (diff)
Use unsigned char instead of u_char in base64.c. This is a mild
portability annoyance since not all systems have u_char. Remove the now unused includes sys/types.h and stdio.h. u_char diff from Jonas Termansen ok deraadt
-rw-r--r--lib/libc/net/base64.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/libc/net/base64.c b/lib/libc/net/base64.c
index eac8b89e636..5f4003d7c1a 100644
--- a/lib/libc/net/base64.c
+++ b/lib/libc/net/base64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: base64.c,v 1.9 2021/10/11 14:32:26 deraadt Exp $ */
+/* $OpenBSD: base64.c,v 1.10 2021/10/22 09:49:26 tb Exp $ */
/*
* Copyright (c) 1996 by Internet Software Consortium.
@@ -42,14 +42,11 @@
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#include <sys/types.h>
-#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <resolv.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -123,14 +120,14 @@ static const char Pad64 = '=';
int
b64_ntop(src, srclength, target, targsize)
- u_char const *src;
+ unsigned char const *src;
size_t srclength;
char *target;
size_t targsize;
{
size_t datalength = 0;
- u_char input[3];
- u_char output[4];
+ unsigned char input[3];
+ unsigned char output[4];
int i;
while (2 < srclength) {
@@ -188,11 +185,11 @@ b64_ntop(src, srclength, target, targsize)
int
b64_pton(src, target, targsize)
char const *src;
- u_char *target;
+ unsigned char *target;
size_t targsize;
{
int tarindex, state, ch;
- u_char nextbyte;
+ unsigned char nextbyte;
char *pos;
state = 0;