1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-08 06:02:22 +03:00

Well, the correct code - that corresponds to current

encode - is below.  I even got the linefeed stuff wrong.

--
marko
This commit is contained in:
Bruce Momjian
2001-05-15 04:45:35 +00:00
parent a8bc265bad
commit 6099009eae

View File

@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: encode.c,v 1.4.2.1 2001/05/13 03:27:49 momjian Exp $ * $Id: encode.c,v 1.4.2.2 2001/05/15 04:45:35 momjian Exp $
*/ */
#include "postgres.h" #include "postgres.h"
@@ -349,7 +349,8 @@ hex_dec_len(uint srclen)
uint uint
b64_enc_len(uint srclen) b64_enc_len(uint srclen)
{ {
return srclen + (srclen + 2 / 3) + (srclen / (76 / 2)) + 2; /* 3 bytes will be converted to 4, linefeed after 76 chars */
return (srclen + 2) * 4 / 3 + srclen / (76 * 3 / 4);
} }
uint uint