projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pipe2: silence compiler warning
[gnulib.git]
/
lib
/
base64.c
diff --git
a/lib/base64.c
b/lib/base64.c
index
8852f7d
..
cbe9a63
100644
(file)
--- a/
lib/base64.c
+++ b/
lib/base64.c
@@
-1,6
+1,5
@@
/* base64.c -- Encode binary data using printable characters.
/* base64.c -- Encode binary data using printable characters.
- Copyright (C) 1999, 2000, 2001, 2004, 2005, 2006 Free Software
- Foundation, Inc.
+ Copyright (C) 1999-2001, 2004-2006, 2009-2011 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-20,7
+19,7
@@
* (mailbox/filter_trans.c, as of 2004-11-28). Improved by review
* from Paul Eggert, Bruno Haible, and Stepan Kasal.
*
* (mailbox/filter_trans.c, as of 2004-11-28). Improved by review
* from Paul Eggert, Bruno Haible, and Stepan Kasal.
*
- * See also RFC
3548 <http://www.ietf.org/rfc/rfc35
48.txt>.
+ * See also RFC
4648 <http://www.ietf.org/rfc/rfc46
48.txt>.
*
* Be careful with error checking. Here is how you would typically
* use these functions:
*
* Be careful with error checking. Here is how you would typically
* use these functions:
@@
-553,10
+552,10
@@
base64_decode_alloc_ctx (struct base64_decode_context *ctx,
{
/* This may allocate a few bytes too many, depending on input,
but it's not worth the extra CPU time to compute the exact size.
{
/* This may allocate a few bytes too many, depending on input,
but it's not worth the extra CPU time to compute the exact size.
- The exact size is 3 *
inlen / 4, minus 1 if the input ends
- with "=" and minus another 1 if the input ends with "==".
+ The exact size is 3 *
(inlen + (ctx ? ctx->i : 0)) / 4, minus 1 if the
+
input ends
with "=" and minus another 1 if the input ends with "==".
Dividing before multiplying avoids the possibility of overflow. */
Dividing before multiplying avoids the possibility of overflow. */
- size_t needlen = 3 * (inlen / 4) +
2
;
+ size_t needlen = 3 * (inlen / 4) +
3
;
*out = malloc (needlen);
if (!*out)
*out = malloc (needlen);
if (!*out)