Subject: Re: base64 support for uu{de,en}code
To: Jason Thorpe <thorpej@shagadelic.org>
From: Thomas Klausner <wiz@NetBSD.org>
List: tech-userlevel
Date: 07/10/2005 13:52:10
On Mon, Jul 04, 2005 at 06:34:20PM -0700, Jason Thorpe wrote:
> Why not .PATH in the base64 coder from libc?  That should be  
> compatible with host-tool'ness, too.

I took a look at it and found two problems with it:
. It returns -1 on every non-whitespace character that's not in the allowed
set. If I understand the RFC correctly, these should just be skipped,
and the uuencode man page from the OpenGroup is very explicit about
that.  Should we fix that?

. When it finds `=' characters when it expects a new quadruple,
it returns -1 (which is ok for base64). However, ``===='' is the
end marker in the uuencode base64 encoding and we can't differentiate
the "end of encoded data" case from an error by the return value.
Suggestions on how to improve that?

 Thomas