aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-01-26 07:17:30 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-01-26 07:17:30 +0000
commit14472a52801290007c082b54630f538d3e8d3209 (patch)
tree09653594812d633d592f9f28df041e99139ae3d1
parent121914fb0f445d2bdf6a15b2e90a54df20d69de5 (diff)
downloadbusybox-w32-14472a52801290007c082b54630f538d3e8d3209.tar.gz
busybox-w32-14472a52801290007c082b54630f538d3e8d3209.tar.bz2
busybox-w32-14472a52801290007c082b54630f538d3e8d3209.zip
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 git-svn-id: svn://busybox.net/trunk/busybox@8348 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--coreutils/uuencode.c2
-rw-r--r--networking/wget.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index fd3326d80..42f629f48 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -59,7 +59,7 @@ static const char tbl_std[65] = {
59 * buffer of at least 1+BASE64_LENGTH(length) bytes. 59 * buffer of at least 1+BASE64_LENGTH(length) bytes.
60 * where BASE64_LENGTH(len) = (4 * ((LENGTH + 2) / 3)) 60 * where BASE64_LENGTH(len) = (4 * ((LENGTH + 2) / 3))
61 */ 61 */
62static void uuencode (const char *s, const char *store, const int length, const char *tbl) 62static void uuencode (const unsigned char *s, const char *store, const int length, const char *tbl)
63{ 63{
64 int i; 64 int i;
65 unsigned char *p = (unsigned char *)store; 65 unsigned char *p = (unsigned char *)store;
diff --git a/networking/wget.c b/networking/wget.c
index 3fd1df124..59f78ac3b 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -119,7 +119,7 @@ static char *safe_fgets(char *s, int size, FILE *stream)
119 * oops... isn't something similar in uuencode.c? 119 * oops... isn't something similar in uuencode.c?
120 * It would be better to use already existing code 120 * It would be better to use already existing code
121 */ 121 */
122char *base64enc(char *p, char *buf, int len) { 122char *base64enc(unsigned char *p, char *buf, int len) {
123 123
124 char al[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 124 char al[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
125 "0123456789+/"; 125 "0123456789+/";
@@ -837,7 +837,7 @@ progressmeter(int flag)
837 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 837 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
838 * SUCH DAMAGE. 838 * SUCH DAMAGE.
839 * 839 *
840 * $Id: wget.c,v 1.66 2004/01/17 23:07:14 bug1 Exp $ 840 * $Id: wget.c,v 1.67 2004/01/26 07:17:30 andersen Exp $
841 */ 841 */
842 842
843 843