diff options
| author | tb <> | 2021-10-22 09:49:26 +0000 | 
|---|---|---|
| committer | tb <> | 2021-10-22 09:49:26 +0000 | 
| commit | 6028b4dd02381c5e20773d89cac6bc3d7dcb7f3b (patch) | |
| tree | 7fd6730c8ceb7cde9c3ffe0d234673fca4f64310 /src/lib/libc | |
| parent | 06dfd5ac4711e33e2577807e4845f49d226f52c7 (diff) | |
| download | openbsd-6028b4dd02381c5e20773d89cac6bc3d7dcb7f3b.tar.gz openbsd-6028b4dd02381c5e20773d89cac6bc3d7dcb7f3b.tar.bz2 openbsd-6028b4dd02381c5e20773d89cac6bc3d7dcb7f3b.zip  | |
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
Diffstat (limited to 'src/lib/libc')
| -rw-r--r-- | src/lib/libc/net/base64.c | 15 | 
1 files changed, 6 insertions, 9 deletions
diff --git a/src/lib/libc/net/base64.c b/src/lib/libc/net/base64.c index eac8b89e63..5f4003d7c1 100644 --- a/src/lib/libc/net/base64.c +++ b/src/lib/libc/net/base64.c  | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: base64.c,v 1.9 2021/10/11 14:32:26 deraadt Exp $ */ | 1 | /* $OpenBSD: base64.c,v 1.10 2021/10/22 09:49:26 tb Exp $ */ | 
| 2 | 2 | ||
| 3 | /* | 3 | /* | 
| 4 | * Copyright (c) 1996 by Internet Software Consortium. | 4 | * Copyright (c) 1996 by Internet Software Consortium. | 
| @@ -42,14 +42,11 @@ | |||
| 42 | * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. | 42 | * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. | 
| 43 | */ | 43 | */ | 
| 44 | 44 | ||
| 45 | #include <sys/types.h> | ||
| 46 | #include <sys/socket.h> | ||
| 47 | #include <netinet/in.h> | 45 | #include <netinet/in.h> | 
| 48 | #include <arpa/inet.h> | 46 | #include <arpa/inet.h> | 
| 49 | 47 | ||
| 50 | #include <ctype.h> | 48 | #include <ctype.h> | 
| 51 | #include <resolv.h> | 49 | #include <resolv.h> | 
| 52 | #include <stdio.h> | ||
| 53 | 50 | ||
| 54 | #include <stdlib.h> | 51 | #include <stdlib.h> | 
| 55 | #include <string.h> | 52 | #include <string.h> | 
| @@ -123,14 +120,14 @@ static const char Pad64 = '='; | |||
| 123 | 120 | ||
| 124 | int | 121 | int | 
| 125 | b64_ntop(src, srclength, target, targsize) | 122 | b64_ntop(src, srclength, target, targsize) | 
| 126 | u_char const *src; | 123 | unsigned char const *src; | 
| 127 | size_t srclength; | 124 | size_t srclength; | 
| 128 | char *target; | 125 | char *target; | 
| 129 | size_t targsize; | 126 | size_t targsize; | 
| 130 | { | 127 | { | 
| 131 | size_t datalength = 0; | 128 | size_t datalength = 0; | 
| 132 | u_char input[3]; | 129 | unsigned char input[3]; | 
| 133 | u_char output[4]; | 130 | unsigned char output[4]; | 
| 134 | int i; | 131 | int i; | 
| 135 | 132 | ||
| 136 | while (2 < srclength) { | 133 | while (2 < srclength) { | 
| @@ -188,11 +185,11 @@ b64_ntop(src, srclength, target, targsize) | |||
| 188 | int | 185 | int | 
| 189 | b64_pton(src, target, targsize) | 186 | b64_pton(src, target, targsize) | 
| 190 | char const *src; | 187 | char const *src; | 
| 191 | u_char *target; | 188 | unsigned char *target; | 
| 192 | size_t targsize; | 189 | size_t targsize; | 
| 193 | { | 190 | { | 
| 194 | int tarindex, state, ch; | 191 | int tarindex, state, ch; | 
| 195 | u_char nextbyte; | 192 | unsigned char nextbyte; | 
| 196 | char *pos; | 193 | char *pos; | 
| 197 | 194 | ||
| 198 | state = 0; | 195 | state = 0; | 
