bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: base64 decoding more tolerant to chars


From: Simon Josefsson
Subject: Re: base64 decoding more tolerant to chars
Date: Tue, 07 Feb 2012 08:34:22 +0100
User-agent: Gnus/5.130001 (Ma Gnus v0.1) Emacs/24.0.92 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Jim Meyering wrote:
>> >  Could also be done, but since the code to remove newlines was there, I
>> > thought it is simpler to augment it to remove common garbage.
>> 
>> I am reluctant to make this low-level decoding function ignore anything
>> else.
>
> I agree. If you remove the garbage unconditionally, you have lost the
> functionality of doing strict checking of the input. If you add a 'bool'
> parameter that determines whether the remove it, you have added complexity
> in the interface (.h file) for nearly nothing.

I agree too -- there are situations where you really don't want to
ignore non-alphabetic characters.  Pre-filtering seems like the right
thing here.

Possibly, the base64 module could provide a separate function for doing
this pre-filtering though?  That doesn't add significant complexity to
the code, but it makes it easy for callers to use.

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]