diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | uuencode.c | 13 |
2 files changed, 16 insertions, 1 deletions
@@ -5,6 +5,10 @@ | |||
5 | [sshconnect2.c] | 5 | [sshconnect2.c] |
6 | refactor the (disabled) Schnorr proof code to make it a little more | 6 | refactor the (disabled) Schnorr proof code to make it a little more |
7 | generally useful | 7 | generally useful |
8 | - djm@cvs.openbsd.org 2009/03/05 11:30:50 | ||
9 | [uuencode.c] | ||
10 | document what these functions do so I don't ever have to recuse into | ||
11 | b64_pton/ntop to remember their return values | ||
8 | 12 | ||
9 | 20090223 | 13 | 20090223 |
10 | - (djm) OpenBSD CVS Sync | 14 | - (djm) OpenBSD CVS Sync |
diff --git a/uuencode.c b/uuencode.c index a13949585..b9e57e993 100644 --- a/uuencode.c +++ b/uuencode.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: uuencode.c,v 1.24 2006/08/03 03:34:42 deraadt Exp $ */ | 1 | /* $OpenBSD: uuencode.c,v 1.25 2009/03/05 11:30:50 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -33,6 +33,12 @@ | |||
33 | #include "xmalloc.h" | 33 | #include "xmalloc.h" |
34 | #include "uuencode.h" | 34 | #include "uuencode.h" |
35 | 35 | ||
36 | /* | ||
37 | * Encode binary 'src' of length 'srclength', writing base64-encoded text | ||
38 | * to 'target' of size 'targsize'. Will always nul-terminate 'target'. | ||
39 | * Returns the number of bytes stored in 'target' or -1 on error (inc. | ||
40 | * 'targsize' too small). | ||
41 | */ | ||
36 | int | 42 | int |
37 | uuencode(const u_char *src, u_int srclength, | 43 | uuencode(const u_char *src, u_int srclength, |
38 | char *target, size_t targsize) | 44 | char *target, size_t targsize) |
@@ -40,6 +46,11 @@ uuencode(const u_char *src, u_int srclength, | |||
40 | return __b64_ntop(src, srclength, target, targsize); | 46 | return __b64_ntop(src, srclength, target, targsize); |
41 | } | 47 | } |
42 | 48 | ||
49 | /* | ||
50 | * Decode base64-encoded 'src' into buffer 'target' of 'targsize' bytes. | ||
51 | * Will skip leading and trailing whitespace. Returns the number of bytes | ||
52 | * stored in 'target' or -1 on error (inc. targsize too small). | ||
53 | */ | ||
43 | int | 54 | int |
44 | uudecode(const char *src, u_char *target, size_t targsize) | 55 | uudecode(const char *src, u_char *target, size_t targsize) |
45 | { | 56 | { |