| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: base64.c,v 1.2 2013/03/24 15:53:58 christos Exp $ */ | | 1 | /* $NetBSD: base64.c,v 1.3 2013/03/24 16:27:58 christos Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2004,2009 by Internet Systems Consortium, Inc. ("ISC") | | 4 | * Copyright (c) 2004,2009 by Internet Systems Consortium, Inc. ("ISC") |
5 | * Copyright (c) 1996-2003 by Internet Software Consortium | | 5 | * Copyright (c) 1996-2003 by Internet Software Consortium |
6 | * | | 6 | * |
7 | * Permission to use, copy, modify, and distribute this software for any | | 7 | * Permission to use, copy, modify, and distribute this software for any |
8 | * purpose with or without fee is hereby granted, provided that the above | | 8 | * purpose with or without fee is hereby granted, provided that the above |
9 | * copyright notice and this permission notice appear in all copies. | | 9 | * copyright notice and this permission notice appear in all copies. |
10 | * | | 10 | * |
11 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES | | 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES |
12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | | 12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR | | 13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR |
14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | | 14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| @@ -197,27 +197,26 @@ b64_ntop(u_char const *src, size_t srcle | | | @@ -197,27 +197,26 @@ b64_ntop(u_char const *src, size_t srcle |
197 | if (datalength >= targsize) | | 197 | if (datalength >= targsize) |
198 | return (-1); | | 198 | return (-1); |
199 | target[datalength] = '\0'; /* Returned value doesn't count \0. */ | | 199 | target[datalength] = '\0'; /* Returned value doesn't count \0. */ |
200 | return (datalength); | | 200 | return (datalength); |
201 | } | | 201 | } |
202 | | | 202 | |
203 | /* skips all whitespace anywhere. | | 203 | /* skips all whitespace anywhere. |
204 | converts characters, four at a time, starting at (or after) | | 204 | converts characters, four at a time, starting at (or after) |
205 | src from base - 64 numbers into three 8 bit bytes in the target area. | | 205 | src from base - 64 numbers into three 8 bit bytes in the target area. |
206 | it returns the number of data bytes stored at the target, or -1 on error. | | 206 | it returns the number of data bytes stored at the target, or -1 on error. |
207 | */ | | 207 | */ |
208 | | | 208 | |
209 | int | | 209 | int |
210 | /*###207 [cc] error: no previous prototype for 'b64_pton'%%%*/ | | | |
211 | b64_pton(char const *src, u_char *target, size_t targsize) | | 210 | b64_pton(char const *src, u_char *target, size_t targsize) |
212 | { | | 211 | { |
213 | int tarindex, state, ch; | | 212 | int tarindex, state, ch; |
214 | char *pos; | | 213 | char *pos; |
215 | | | 214 | |
216 | state = 0; | | 215 | state = 0; |
217 | tarindex = 0; | | 216 | tarindex = 0; |
218 | | | 217 | |
219 | while ((ch = *src++) != '\0') { | | 218 | while ((ch = *src++) != '\0') { |
220 | if (isspace(ch)) /* Skip whitespace anywhere. */ | | 219 | if (isspace(ch)) /* Skip whitespace anywhere. */ |
221 | continue; | | 220 | continue; |
222 | | | 221 | |
223 | if (ch == Pad64) | | 222 | if (ch == Pad64) |