]> diplodocus.org Git - nmh/blobdiff - sbr/fmt_rfc2047.c
Fix invalid pointer arithmetic.
[nmh] / sbr / fmt_rfc2047.c
index a43b5dc12eb5f5ba68070e51641038a92fee62b4..8c799e14c77b1197c684ab446c163df018c31b66 100644 (file)
@@ -52,7 +52,7 @@ decode_qp (unsigned char byte1, unsigned char byte2)
 {
     if (hexindex[byte1] == -1 || hexindex[byte2] == -1)
        return -1;
-    return (hexindex[byte1] << 4 | hexindex[byte2]);
+    return hexindex[byte1] << 4 | hexindex[byte2];
 }
 
 /* Check if character is linear whitespace */
@@ -229,7 +229,7 @@ decode_rfc2047 (char *str, char *dst, size_t dstlen)
            if (use_iconv) {
                saveq = q;
                savedstlen = dstlen;
-                q = convbuf = (char *) mh_xmalloc(endofmime - startofmime);
+                q = convbuf = mh_xmalloc(endofmime - startofmime);
             }
 /* ADDCHR2 is for adding characters when q is or might be convbuf:
  * in this case on buffer-full we want to run iconv before returning.