summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--uuencode.c13
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index dde0669b6..8c18430a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
920090223 1320090223
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 */
36int 42int
37uuencode(const u_char *src, u_int srclength, 43uuencode(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 */
43int 54int
44uudecode(const char *src, u_char *target, size_t targsize) 55uudecode(const char *src, u_char *target, size_t targsize)
45{ 56{