Pascal Brisset writes:
uuencode fails to encode binary data because it right-shifts bytes as signed chars and keeps the duplicated sign bits. The original base64_encode() from wget/http.c is broken as well, but it is only used to encode ascii data. -- Pascal
This commit is contained in:
parent
7018385fe7
commit
f2ec37902a
@ -59,7 +59,7 @@ static const char tbl_std[65] = {
|
|||||||
* buffer of at least 1+BASE64_LENGTH(length) bytes.
|
* buffer of at least 1+BASE64_LENGTH(length) bytes.
|
||||||
* where BASE64_LENGTH(len) = (4 * ((LENGTH + 2) / 3))
|
* where BASE64_LENGTH(len) = (4 * ((LENGTH + 2) / 3))
|
||||||
*/
|
*/
|
||||||
static void uuencode (const char *s, const char *store, const int length, const char *tbl)
|
static void uuencode (const unsigned char *s, const char *store, const int length, const char *tbl)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned char *p = (unsigned char *)store;
|
unsigned char *p = (unsigned char *)store;
|
||||||
|
@ -119,7 +119,7 @@ static char *safe_fgets(char *s, int size, FILE *stream)
|
|||||||
* oops... isn't something similar in uuencode.c?
|
* oops... isn't something similar in uuencode.c?
|
||||||
* It would be better to use already existing code
|
* It would be better to use already existing code
|
||||||
*/
|
*/
|
||||||
char *base64enc(char *p, char *buf, int len) {
|
char *base64enc(unsigned char *p, char *buf, int len) {
|
||||||
|
|
||||||
char al[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
|
char al[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
|
||||||
"0123456789+/";
|
"0123456789+/";
|
||||||
@ -837,7 +837,7 @@ progressmeter(int flag)
|
|||||||
* 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: wget.c,v 1.66 2004/01/17 23:07:14 bug1 Exp $
|
* $Id: wget.c,v 1.67 2004/01/26 07:17:30 andersen Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user