]> diplodocus.org Git - nmh/blobdiff - uip/mhparse.c
Check that script(1) supports SHELL in test-version-check.
[nmh] / uip / mhparse.c
index 984b1430aac6be2fc997f5dcb8525c7c87f76fdf..40fe61d5f8fe69c95438cd145abc481a6b576044 100644 (file)
@@ -151,7 +151,6 @@ static int openURL (CT, char **);
 static int parse_header_attrs (const char *, const char *, char **, PM *,
                               PM *, char **);
 static size_t param_len(PM, int, size_t, int *, int *, size_t *);
-static size_t encode_param(PM, char *, size_t, size_t, size_t, int);
 static size_t normal_param(PM, char *, size_t, size_t, size_t);
 static int get_dispo (char *, CT, int);
 
@@ -1751,7 +1750,7 @@ openBase64 (CT ct, char **file)
     /* sbeck -- handle suffixes */
     CI ci;
     CE ce = &ct->c_cefile;
-    const char *decoded;
+    unsigned char *decoded;
     size_t decoded_len;
     unsigned char digest[16];
 
@@ -1840,10 +1839,11 @@ openBase64 (CT ct, char **file)
     if (decodeBase64 (buffer, &decoded, &decoded_len, ct->c_type == CT_TEXT,
                       ct->c_digested ? digest : NULL) == OK) {
         size_t i;
-        const char *decoded_p = decoded;
+        unsigned char *decoded_p = decoded;
         for (i = 0; i < decoded_len; ++i) {
             putc (*decoded_p++, ce->ce_fp);
         }
+        free ((char *) decoded);
         if (ferror (ce->ce_fp)) {
             content_error (ce->ce_file, ct, "error writing to");
             goto clean_up;
@@ -2906,13 +2906,13 @@ openURL (CT ct, char **file)
 static int
 readDigest (CT ct, char *cp)
 {
-    const char *digest;
+    unsigned char *digest;
 
     size_t len;
     if (decodeBase64 (cp, &digest, &len, 0, NULL) == OK) {
         const size_t maxlen = sizeof ct->c_digest / sizeof ct->c_digest[0];
 
-        if (strlen (digest) <= maxlen) {
+        if (strlen ((char *) digest) <= maxlen) {
             memcpy (ct->c_digest, digest, maxlen);
 
             if (debugsw) {
@@ -2929,7 +2929,7 @@ readDigest (CT ct, char *cp)
         } else {
             if (debugsw) {
                 fprintf (stderr, "invalid MD5 digest (got %d octets)\n",
-                         (int) strlen (digest));
+                         (int) strlen ((char *) digest));
             }
 
             return NOTOK;
@@ -3980,7 +3980,7 @@ param_len(PM pm, int index, size_t valueoff, int *encode, int *cont,
  * Output an encoded parameter string.
  */
 
-static size_t
+size_t
 encode_param(PM pm, char *output, size_t len, size_t valuelen,
              size_t valueoff, int index)
 {