From fcde551ee863782ec11f9b9f5115f8527cc7daa3 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 22 Oct 2021 09:49:26 +0000 Subject: [PATCH] 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 --- lib/libc/net/base64.c | 15 ++++++--------- 1 file 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 -#include #include #include #include #include -#include #include #include @@ -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; -- 2.20.1