bug-gnulib
[Top][All Lists]
Advanced

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

[bug-gnulib] Re: base64


From: Simon Josefsson
Subject: [bug-gnulib] Re: base64
Date: Sat, 27 Nov 2004 13:42:38 +0100
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Paul Eggert <address@hidden> writes:

> Simon Josefsson <address@hidden> writes:
>
>>   size_t outlen = xsum (1, xtimes (xmax (inlen, inlen + 2) / 3, 4));
>
> Sorry, I don't really follow this.  What is the xmax (inlen, inlen +
> 2) doing?  Why isn't it xsum (inlen, 2)?  Perhaps a comment would be
> helpful, saying how many bytes you need (mathematically speaking) and
> what the overflow checking is trying to do.  Personally I'd rather
> avoid xsize.h entirely, but I can't suggest how to do that unless I
> know what the code really wants to do here.

The goal is to compute:

#define BASE64_LENGTH(inlen) ((((inlen) + 2) / 3) * 4)

plus one, with overflow checking.  Yes, xmax should be xsum.

If it is possible to avoid xsize, I think that would be better as
well.





reply via email to

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